<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="http://git.reviewboard.kde.org/r/105831/">http://git.reviewboard.kde.org/r/105831/</a>
     </td>
    </tr>
   </table>
   <br />





<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
 <p style="margin-top: 0;">On August 3rd, 2012, 8:49 a.m., <b>David Faure</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">"Actually we need to test both source and destination to check if their protocols support symlink creation."

Haha, if we're copying a symlink, then obviously the source protocol supports symlinks, otherwise it wouldn't be there in the first place :-)</pre>
 </blockquote>




 <p>On August 3rd, 2012, 12:47 p.m., <b>Lamarque Vieira Souza</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I meant supports *creating* symlinks, not only *showing* symlinks. ftp kio protocol does not support creating symlinks according to its ftp.protocol file.</pre>
 </blockquote>





 <p>On August 5th, 2012, 9:32 a.m., <b>David Faure</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">So? If you're copying a symlink *from* FTP to the local harddrive, what should it matter, that kio_ftp cannot *create* symlinks? The symlink is there, it exists, so checking whether kio_ftp can create symlinks is totally irrelevant. Only the capability of the destination protocol matters, not the one of the source protocol.</pre>
 </blockquote>





 <p>On August 5th, 2012, 4:47 p.m., <b>Lamarque Vieira Souza</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I am using that heuristics to avoid the symlink with ftp problem to come back (bug #5601). If I just test the destination protocol it will always create a symlink if the destination protocol is "file". We could call KIO::symlink() if both source and destination are local, do you know a way to detect that besides checking if QUrl::host() is empty?</pre>
 </blockquote>





 <p>On August 6th, 2012, 12:58 p.m., <b>David Faure</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">You realize how wrong that heuristic is, right? It's testing for something completely unrelated to the operation at hand, just to exclude FTP, in order to work around a problem, which isn't even specific to FTP (the issue that we sometimes want to copy symlinks as is, and sometimes to copy their target).

You can detect "pseudo-local" protocols using KProtocolInfo::protocolClass(url.protocol()) == ":local", but this sounds like a hack too.

Don't you agree that the real fix would be to copy source URLs (i.e. objects actually dragged by the user) by following symlinks, and to copy symlinks as symlinks otherwise (when we encounter one inside a directory that we're copying)?
This doesn't help with the issue that FTP can't distinguish symlinks to files and to directories, but that's orthogonal, let's use fish or sftp as examples instead, if they do distinguish these correctly.</pre>
 </blockquote>








</blockquote>

<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I am aware that my heuristic is not a perfect solution. kio_fish shows the same problem kio_ftp does. I like your proposal. If we remove the "only run symlink() if both source and destination use the same protocol" from kdelibs it works almost like that. Of course, if the destination does not support symlink we must copy the target instead and that can be a problem if the target is a directory. Currently, kdelibs creates all directories first before copying the files inside the directories, but by the time this part of source code run the directory creation loop has already finished. If you are right that the problem of not distinguishing link target type is in the protocol then we would have to fix that for ftp and fish at least. I am not sure that this last problem is in the protocols. I will take a look at this problem when I have more time.</pre>
<br />








<p>- Lamarque Vieira</p>


<br />
<p>On August 2nd, 2012, 9:31 p.m., Lamarque Vieira Souza wrote:</p>






<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('http://git.reviewboard.kde.org/media/rb/images/review_request_box_top_bg.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
 <tr>
  <td>

<div>Review request for kdelibs.</div>
<div>By Lamarque Vieira Souza.</div>


<p style="color: grey;"><i>Updated Aug. 2, 2012, 9:31 p.m.</i></p>






<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;">Some kio protocols support creating symlinks but a change in kio/kio/copyjob.cpp hardcoded symlink creation to only when source and destination protocols are the same. That change was added to fix a problem with ftp protocol creating symlinks instead of copying files (there is a comment in the source code about that). I think instead of forcing source and destination use the same protocol we should test if the destination protocol supports creating symlinks (ftp protocol does not). That would allow kio's like fish and nfs create symlinks. I am also working on some other changes that could use this feature.</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>kio/kio/copyjob.cpp <span style="color: grey">(8dde763)</span></li>

</ul>

<p><a href="http://git.reviewboard.kde.org/r/105831/diff/" style="margin-left: 3em;">View Diff</a></p>




  </td>
 </tr>
</table>








  </div>
 </body>
</html>