<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/119607/">https://git.reviewboard.kde.org/r/119607/</a>
</td>
</tr>
</table>
<br />
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<p style="margin-top: 0;">On Novembro 8th, 2014, 10:02 p.m. UTC, <b>David Faure</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
<thead>
<tr>
<th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
<a href="https://git.reviewboard.kde.org/r/119607/diff/4/?file=313121#file313121line1241" style="color: black; font-weight: bold; text-decoration: underline;">src/core/kcoredirlister.cpp</a>
<span style="font-weight: normal;">
(Diff revision 4)
</span>
</th>
</tr>
</thead>
<tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
<tr>
<td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">void KCoreDirListerCache::slotEntries(KIO::Job *job, const KIO::UDSEntryList &entries)</pre></td>
</tr>
</tbody>
<tbody>
<tr>
<th bgcolor="#f0f0f0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">1237</font></th>
<td bgcolor="#ffffff" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span class="n">dir</span><span class="o">-></span><span class="n">rootItem</span> <span class="o">=</span> <span class="n">KFileItem</span><span class="p">(</span><span class="o">*</span><span class="n">it</span><span class="p">,</span> <span class="n">url</span><span class="p">,</span> <span class="n">delayedMimeTypes</span><span class="p">,</span> <span class="nb">true</span><span class="p">);</span></pre></td>
<th bgcolor="#f0f0f0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">1241</font></th>
<td bgcolor="#ffffff" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span class="n">dir</span><span class="o">-></span><span class="n">rootItem</span> <span class="o">=</span> <span class="n">KFileItem</span><span class="p">(</span><span class="o">*</span><span class="n">it</span><span class="p">,</span> <span class="n">url</span><span class="p">,</span> <span class="n">delayedMimeTypes</span><span class="p">,</span> <span class="nb">true</span><span class="p">);</span></pre></td>
</tr>
</tbody>
</table>
<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;">After this line, try adding</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 style="color: #008000; font-weight: bold">if</span> (<span style="color: #666666">!</span>url.isLocalFile()) {
<span style="color: #008000; font-weight: bold">const</span> QString localPath <span style="color: #666666">=</span> dir<span style="color: #666666">-></span>rootItem.localPath();
<span style="color: #008000; font-weight: bold">if</span> (<span style="color: #666666">!</span>localPath.isEmpty()) {
filesToHide <span style="color: #666666">=</span> filesInDotHiddenForDir(QUrl<span style="color: #666666">::</span>fromLocalFile(localPath));
}
}
</pre></div>
</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">This should take care of the case of desktop:/ URLs. Can you test?</p></pre>
</blockquote>
<p>On Novembro 10th, 2014, 11:45 a.m. UTC, <b>Bruno Nova</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;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Thanks! I'll test it in a few days. I haven't had time to look into this yet.</p></pre>
</blockquote>
<p>On Dezembro 4th, 2014, 12:20 p.m. UTC, <b>Bruno Nova</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;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">I finally had the time to look at this again.
I tested this, and <code style="text-rendering: inherit;color: #4444cc;padding: 0;white-space: normal;margin: 0;line-height: inherit;">dir->rootItem.localPath()</code> does indeed work for the <code style="text-rendering: inherit;color: #4444cc;padding: 0;white-space: normal;margin: 0;line-height: inherit;">desktop:/</code> directory.
However, from my tests, the root item/current directory (<code style="text-rendering: inherit;color: #4444cc;padding: 0;white-space: normal;margin: 0;line-height: inherit;">.</code>) is not the first item in the UDSEntryList being iterated. So, some files are not hidden.
I need that rootItem before the loop. I'll see if I can do something about it (without iterating twice or iterating back from <code style="text-rendering: inherit;color: #4444cc;padding: 0;white-space: normal;margin: 0;line-height: inherit;">.</code> in the loop).</p></pre>
</blockquote>
<p>On Dezembro 4th, 2014, 2:56 p.m. UTC, <b>Bruno Nova</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;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">@David, do you think iterating a second time over the UDSEntryList just to find the ".hidden" file would have a noticeable impact on performance in very large folders? And would it be acceptable?
I just tried that, and it worked, even in <code style="text-rendering: inherit;color: #4444cc;padding: 0;white-space: normal;margin: 0;line-height: inherit;">desktop:/</code>. I didn't notice any noticeable slowdown when I opened <em style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">/usr/bin</em>. I added that second loop above the existing loop (this could then be placed in the <code style="text-rendering: inherit;color: #4444cc;padding: 0;white-space: normal;margin: 0;line-height: inherit;">filesInDotHiddenForDir()</code> method).
With my limited knowledge of KDE, I don't see another way of getting a KFileItem (of <code style="text-rendering: inherit;color: #4444cc;padding: 0;white-space: normal;margin: 0;line-height: inherit;">.</code> or <code style="text-rendering: inherit;color: #4444cc;padding: 0;white-space: normal;margin: 0;line-height: inherit;">.hidden</code>) from a UDSEntry before that loop (since KFileItem's contructed from QUrl's are not "complete").</p></pre>
</blockquote>
<p>On Dezembro 4th, 2014, 3:03 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;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Hmm, then maybe use localPath on the first item instead, whichever it is, and remove the filename, to go up to the parent directory?</p></pre>
</blockquote>
</blockquote>
<pre style="margin-left: 1em; 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;">Why didn't I think of that? That seems to be the best solution!</p></pre>
<br />
<p>- Bruno</p>
<br />
<p>On Setembro 18th, 2014, 10:06 a.m. UTC, Bruno Nova 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 KDE Frameworks and David Faure.</div>
<div>By Bruno Nova.</div>
<p style="color: grey;"><i>Updated Set. 18, 2014, 10:06 a.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=64740">64740</a>,
<a href="https://bugs.kde.org/show_bug.cgi?id=246260">246260</a>
</div>
<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;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">This adds support for <em style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">.hidden</em> files to KDE.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">When listing a directory, the files/folders listed in the <em style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">.hidden</em> file will be hidden, unless the user has chosen to show hidden files.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">This patch was initially based on the patch provided by Mark in Bug #246260.</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;">Built and tested the patch in Project Neon.
Dolphin was still using KDE4/Qt4 version of the library, so I only tested using the desktop folder widget, and "folder desktop".
It worked correctly when I pointed it to "~" and "~/Desktop" (I added ".hidden" there).
However, it didn't work when I pointed it to the "Desktop folder" (the default option, not the custom location "~/Desktop").
More testing is required.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">The version for KDE4/Qt4 submitted to Bug #246260 was tested in Kubuntu 14.04, and it worked everywhere I tested (Dolphin, open/save dialogs, folder widget and detailed/tree view in Dolphin).
It wasn't an intensive test, though.</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/core/kcoredirlister.h <span style="color: grey">(e6ba2ac)</span></li>
<li>src/core/kcoredirlister.cpp <span style="color: grey">(a31d629)</span></li>
<li>src/core/kfileitem.h <span style="color: grey">(bebc241)</span></li>
<li>src/core/kfileitem.cpp <span style="color: grey">(74dc069)</span></li>
</ul>
<p><a href="https://git.reviewboard.kde.org/r/119607/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>