<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="https://git.reviewboard.kde.org/r/114693/">https://git.reviewboard.kde.org/r/114693/</a>
     </td>
    </tr>
   </table>
   <br />





<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
 <p style="margin-top: 0;">On December 30th, 2013, 9:54 p.m. UTC, <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;">Ah I see, the issue is when calling setLocationText() with a relative URL.

The KDE4 code (inside setLocationText) would say

if (url.hasPath()) {
    if (!url.directory().isEmpty()) {
        q->setUrl(...);
    } else {
        q->setUrl(url.path(), false);
    }
}

When called with a relative url, url.path() is "passwd", we end up in 
KDirOperator::setUrl("passwd"), which errors out in the KIO::NetAccess::stat check.

Much work for nothing indeed, we should just skip the whole setUrl when called with a relative URL.

This hasPath() was wrong, it should have been a "is not relative" check.

Back to KF5: does this fix it?

-        if (!url.path().isEmpty()) {
+        if (!url.isRelative()) {

I'm curious as to why the setUrl("passwd") behaved differently from kde4 though?

</pre>
 </blockquote>




 <p>On December 30th, 2013, 10 p.m. UTC, <b>Michal Humpula</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;">this might explain the difference of (Q|K)Url(QString) constructor: http://community.kde.org/Frameworks/Porting_Notes#KDECore_Changes</pre>
 </blockquote>





 <p>On December 30th, 2013, 10:08 p.m. UTC, <b>Michal Humpula</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;">yep, that works.

(damn, two tries and none of them were right:) I suppose I can close this and you will commit your own fix with the testcase. Ok?</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;">Thanks for the link to my own documentation :-)

I don't think this is the issue, since QUrl("passwd") and KUrl("passwd") work the same (relative URL, path=="passwd").

OK, I'll commit my fix. I'm still a bit unsure as to why this failed in kf5 though, i.e. where is really the behavior difference between kde4 and kf5 (this if() was equally broken in both....), I suspect a porting bug is left somewhere. Would need more comparative debugging to find where - but my fix will hide that for this particular testcase.</pre>
<br />










<p>- David</p>


<br />
<p>On December 30th, 2013, 9 p.m. UTC, Michal Humpula wrote:</p>








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

<div>Review request for KDE Frameworks.</div>
<div>By Michal Humpula.</div>


<p style="color: grey;"><i>Updated Dec. 30, 2013, 9 p.m.</i></p>









<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
kio
</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;">If I understand correctly documentation of KFileWidget, it should be perfectly ok to do something like this:

KEncodingFileDialog::getOpenUrlsAndEncoding(QString(), 
QUrl("file:///etc/passwd"));

But that doesn't display the thing I'm expecting. Tracing it down I came up with the fix. I'm not claiming that it's the correct one, but at least in my situation the KFileWidget behaves as expected in all tested situations. 

Surprisingly the

void KFileWidgetPrivate::setLocationText(const QList<QUrl> &urlList)

doesn't call any setUrl, which hints that it could actually be correct.</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/filewidgets/kfilewidget.cpp <span style="color: grey">(11597b3)</span></li>

</ul>

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







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








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