<table><tr><td style="">meven added a subscriber: dfaure.<br />meven added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D22801">View Revision</a></tr></table><br /><div><div><blockquote style="border-left: 3px solid #8C98B8;
          color: #6B748C;
          font-style: italic;
          margin: 4px 0 12px 0;
          padding: 8px 12px;
          background-color: #F8F9FC;">
<div style="font-style: normal;
          padding-bottom: 4px;">In <a href="https://phabricator.kde.org/D22801#561989" style="background-color: #e7e7e7;
          border-color: #e7e7e7;
          border-radius: 3px;
          padding: 0 4px;
          font-weight: bold;
          color: black;text-decoration: none;">D22801#561989</a>, <a href="https://phabricator.kde.org/p/rjvbb/" style="
              border-color: #f1f7ff;
              color: #19558d;
              background-color: #f1f7ff;
                border: 1px solid transparent;
                border-radius: 3px;
                font-weight: bold;
                padding: 0 4px;">@rjvbb</a> wrote:</div>
<div style="margin: 0;
          padding: 0;
          border: 0;
          color: rgb(107, 116, 140);"><p>Are you not seeing these for instance when browsing an MSWin share in Dolphin (with the same or newer versions of kio-extras, Samba and MSWin)?รง</p></div>
</blockquote>

<p>I don't have a samba (or MS) share available currently, unfortunately I can't test, but I might later.</p>

<blockquote style="border-left: 3px solid #a7b5bf; color: #464c5c; font-style: italic; margin: 4px 0 12px 0; padding: 4px 12px; background-color: #f8f9fc;"><p>I tried to figure out where they came from but failed because of the async nature of the chain of events. I presume the empty paths come from the smb KIO plugin and then somehow make it to where the warning is printed.</p></blockquote>

<p>I would suggest adding a dumb qDebug() appriopriately or panic whenever findByPath is called with an emtpy path.<br />
In <tt style="background: #ebebeb; font-size: 13px;">previewjob.cpp</tt> What was <tt style="background: #ebebeb; font-size: 13px;">PreviewJobPrivate</tt> <tt style="background: #ebebeb; font-size: 13px;">KFileItemList initialItems</tt> when this happened ?</p>

<blockquote style="border-left: 3px solid #a7b5bf; color: #464c5c; font-style: italic; margin: 4px 0 12px 0; padding: 4px 12px; background-color: #f8f9fc;"><div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">I also considered that findByPath() already accepts non-existing ppathsaths and handles them appropriately, it could (and probably should) do the same with an empty path.</pre></div></blockquote>

<p>I disagree since it will change the current precondition of the function for the need of one of its users.<br />
A warning is an explicit indication that assumption made writing the code are broken either because they are overstepped or were too limited when writing the code.</p>

<p>findPath is documented as :</p>

<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">/**
 * Find the mountpoint on which resides @p path
 * For instance if /home is a separate partition, findByPath("/home/user/blah")
 * will return /home
 * @param path the path to check
 * @return the mount point of the given file
 */
Ptr findByPath(const QString &path) const;</pre></div>

<p>It makes no sense to check the mountpoint of an empty path that by essence cannot be a file.<br />
This might hide others bugs elsewhere.</p>

<blockquote style="border-left: 3px solid #a7b5bf; color: #464c5c; font-style: italic; margin: 4px 0 12px 0; padding: 4px 12px; background-color: #f8f9fc;"><p>Regardless of the fact that the smb plugin probaby shouldn't output empty paths; maybe the maintainer(s) of that software should be CC'ed here?</p></blockquote>

<p>KIO is an old code-base and is maintained collectively mostly (with a single main maintainer <a href="https://phabricator.kde.org/p/dfaure/" style="
              border-color: #f1f7ff;
              color: #19558d;
              background-color: #f1f7ff;
                border: 1px solid transparent;
                border-radius: 3px;
                font-weight: bold;
                padding: 0 4px;">@dfaure</a>), we need to use our own wits.</p>

<p>Btw do you use a samba mount(/etc/fstab defined or <tt style="background: #ebebeb; font-size: 13px;">mount -t smb</tt>) or the <tt style="background: #ebebeb; font-size: 13px;">smb://</tt> ioslave ? You must mean the <tt style="background: #ebebeb; font-size: 13px;">smb://</tt> ioslave with <tt style="background: #ebebeb; font-size: 13px;">smb plugin</tt>.<br />
In which case we might want to check the samba kio-extras code as well, in particular <tt style="background: #ebebeb; font-size: 13px;">SMBSlave::listDir</tt> that returns the files contained in a folder.<br />
Does it returns files with empty urls ?</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R241 KIO</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D22801">https://phabricator.kde.org/D22801</a></div></div><br /><div><strong>To: </strong>rjvbb, Frameworks<br /><strong>Cc: </strong>dfaure, meven, kde-frameworks-devel, LeGast00n, GB_2, michaelh, ngraham, bruns<br /></div>