[prev in list] [next in list] [prev in thread] [next in thread]
List: kfm-devel
Subject: Re: Review Request 129714: Disable rename action from Trash
From: Emmanuel Pescosta <emmanuelpescosta099 () gmail ! com>
Date: 2017-01-01 19:05:30
Message-ID: 20170101190530.26347.87473 () mimi ! kde ! org
[Download RAW message or body]
--===============6920985587651339584==
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/129714/#review101710
-----------------------------------------------------------
I think that we should add a `KProtocolManager::supportsRenaming` (with `renaming = \
true` as default) instead of adding special cases to client applications. What do you \
think?
- Emmanuel Pescosta
On Dec. 28, 2016, 4:30 p.m., Elvis Angelaccio wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/129714/
> -----------------------------------------------------------
>
> (Updated Dec. 28, 2016, 4:30 p.m.)
>
>
> Review request for Dolphin and Emmanuel Pescosta.
>
>
> Bugs: 332465
> https://bugs.kde.org/show_bug.cgi?id=332465
>
>
> Repository: dolphin
>
>
> Description
> -------
>
> Dolphin relies on KFileItemListProperties::supportsMoving() to enable/disable the \
> rename action. However, the trash:/ protocol is a corner case because while it \
> supports moving, it explicitly forbids renaming urls from trash:/ to trash:/
> ```c++
> // kio_trash.cpp, line 137
> if (oldURL.scheme() == QLatin1String("trash") && newURL.scheme() == \
> QLatin1String("trash")) { error(KIO::ERR_CANNOT_RENAME, oldURL.toString());
> return;
> }
> ```
>
> For this reason, we need to disable the rename action if the view is in the Trash.
>
> BUG: 332465
> FIXED-IN: 16.12.1
>
>
> Diffs
> -----
>
> src/dolphinmainwindow.cpp e5103fd42
> src/dolphinpart.cpp aa9ab2986
>
> Diff: https://git.reviewboard.kde.org/r/129714/diff/
>
>
> Testing
> -------
>
> F2 from Trash no longer triggers a useless rename job.
>
>
> Thanks,
>
> Elvis Angelaccio
>
>
--===============6920985587651339584==
MIME-Version: 1.0
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: 7bit
<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="12" style="border: 1px #c9c399 \
solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;"> \
<tr> <td>
This is an automatically generated e-mail. To reply, visit:
<a href="https://git.reviewboard.kde.org/r/129714/">https://git.reviewboard.kde.org/r/129714/</a>
</td>
</tr>
</table>
<br />
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: \
0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">I \
think that we should add a <code style="text-rendering: inherit;color: \
#4444cc;padding: 0;white-space: normal;margin: 0;line-height: \
inherit;">KProtocolManager::supportsRenaming</code> (with <code \
style="text-rendering: inherit;color: #4444cc;padding: 0;white-space: normal;margin: \
0;line-height: inherit;">renaming = true</code> as default) instead of adding special \
cases to client applications. What do you think?</p></pre> <br />
<p>- Emmanuel Pescosta</p>
<br />
<p>On December 28th, 2016, 4:30 p.m. CET, Elvis Angelaccio wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="12" style="border: \
1px #888a85 solid; border-radius: 6px; -moz-border-radius: 6px; \
-webkit-border-radius: 6px;"> <tr>
<td>
<div>Review request for Dolphin and Emmanuel Pescosta.</div>
<div>By Elvis Angelaccio.</div>
<p style="color: grey;"><i>Updated Dec. 28, 2016, 4:30 p.m.</i></p>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>
<a href="https://bugs.kde.org/show_bug.cgi?id=332465">332465</a>
</div>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt;">Repository: </b>
dolphin
</div>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" \
style="border: 1px solid #b8b5a0"> <tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">Dolphin relies on \
KFileItemListProperties::supportsMoving() to enable/disable the rename action. \
However, the trash:/ protocol is a corner case because while it supports moving, it \
explicitly forbids renaming urls from trash:/ to trash:/</p> <p style="padding: \
0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;"><div \
class="codehilite" style="background: #f8f8f8"><pre style="line-height: \
125%"><span></span><span style="color: #408080; font-style: italic">// kio_trash.cpp, \
line 137</span> <span style="color: #008000; font-weight: bold">if</span> \
(oldURL.scheme() <span style="color: #666666">==</span> QLatin1String(<span \
style="color: #BA2121">"trash"</span>) <span style="color: \
#666666">&&</span> newURL.scheme() <span style="color: #666666">==</span> \
QLatin1String(<span style="color: #BA2121">"trash"</span>)) { \
error(KIO<span style="color: #666666">::</span>ERR_CANNOT_RENAME, oldURL.toString()); \
<span style="color: #008000; font-weight: bold">return</span>; }
</pre></div>
</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">For this reason, we need to disable the rename action \
if the view is in the Trash.</p> <p style="padding: 0;text-rendering: inherit;margin: \
0;line-height: inherit;white-space: inherit;">BUG: 332465
FIXED-IN: 16.12.1</p></pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: \
1px solid #b8b5a0"> <tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">F2 from Trash no longer triggers a useless rename \
job.</p></pre> </td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>src/dolphinmainwindow.cpp <span style="color: grey">(e5103fd42)</span></li>
<li>src/dolphinpart.cpp <span style="color: grey">(aa9ab2986)</span></li>
</ul>
<p><a href="https://git.reviewboard.kde.org/r/129714/diff/" style="margin-left: \
3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>
--===============6920985587651339584==--
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic