Review Request 119607: Support for ".hidden" files

Bruno Nova brunomb.nova at gmail.com
Thu Dec 4 22:06:37 UTC 2014



> On Nov. 8, 2014, 10:02 p.m., David Faure wrote:
> > src/core/kcoredirlister.cpp, line 1241
> > <https://git.reviewboard.kde.org/r/119607/diff/4/?file=313121#file313121line1241>
> >
> >     After this line, try adding
> >     
> >         if (!url.isLocalFile()) {
> >             const QString localPath = dir->rootItem.localPath();
> >             if (!localPath.isEmpty()) {
> >                 filesToHide = filesInDotHiddenForDir(QUrl::fromLocalFile(localPath));
> >             }
> >         }
> >         
> >     This should take care of the case of desktop:/ URLs. Can you test?
> 
> Bruno Nova wrote:
>     Thanks! I'll test it in a few days. I haven't had time to look into this yet.
> 
> Bruno Nova wrote:
>     I finally had the time to look at this again.
>     I tested this, and `dir->rootItem.localPath()` does indeed work for the `desktop:/` directory.
>     However, from my tests, the root item/current directory (`.`) 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 `.` in the loop).
> 
> Bruno Nova wrote:
>     @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 `desktop:/`. I didn't notice any noticeable slowdown when I opened */usr/bin*. I added that second loop above the existing loop (this could then be placed in the `filesInDotHiddenForDir()` method).
>     With my limited knowledge of KDE, I don't see another way of getting a KFileItem (of `.` or `.hidden`) from a UDSEntry before that loop (since KFileItem's contructed from QUrl's are not "complete").
> 
> David Faure wrote:
>     Hmm, then maybe use localPath on the first item instead, whichever it is, and remove the filename, to go up to the parent directory?
> 
> Bruno Nova wrote:
>     Why didn't I think of that? That seems to be the best solution!

I uploaded a new patch. Your solution seems to work perfectly!


- Bruno


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/119607/#review70102
-----------------------------------------------------------


On Dez. 4, 2014, 9:55 p.m., Bruno Nova wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/119607/
> -----------------------------------------------------------
> 
> (Updated Dez. 4, 2014, 9:55 p.m.)
> 
> 
> Review request for KDE Frameworks and David Faure.
> 
> 
> Bugs: 64740 and 246260
>     https://bugs.kde.org/show_bug.cgi?id=64740
>     https://bugs.kde.org/show_bug.cgi?id=246260
> 
> 
> Repository: kio
> 
> 
> Description
> -------
> 
> This adds support for *.hidden* files to KDE.
> 
> When listing a directory, the files/folders listed in the *.hidden* file will be hidden, unless the user has chosen to show hidden files.
> 
> This patch was initially based on the patch provided by Mark in Bug #246260.
> 
> 
> Diffs
> -----
> 
>   src/core/kcoredirlister.cpp a31d629 
>   src/core/kcoredirlister_p.h dce7dbc 
>   src/core/kfileitem.h bebc241 
>   src/core/kfileitem.cpp 74dc069 
> 
> Diff: https://git.reviewboard.kde.org/r/119607/diff/
> 
> 
> Testing
> -------
> 
> 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.
> 
> 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.
> 
> 
> Thanks,
> 
> Bruno Nova
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20141204/6c940c34/attachment.html>


More information about the Kde-frameworks-devel mailing list