Review Request 119607: Support for ".hidden" files

David Faure faure at kde.org
Wed Sep 17 20:05:23 UTC 2014



> On Sept. 14, 2014, 3:27 p.m., Frank Reininghaus wrote:
> > src/core/kcoredirlister.cpp, line 2799
> > <https://git.reviewboard.kde.org/r/119607/diff/2/?file=301215#file301215line2799>
> >
> >     This will only work for local files. I'm not sure if we would want to support the ".hidden" mechanism also for other protocols, such as sftp or fish?
> >     
> >     Moreover, I think that we might want to cache the contents of the .hidden file, to prevent that we read it, parse it and construct the QSet with the hidden files over and over again if a kioslave reports the UDSEntries in multiple batches.

Supporting .hidden for remote protocols would be much more complex (async API).

Caching: it would have to include an mtime, to be able to detect changes. But indeed caching the last one read would be good, because while having a directory open, any change triggers an update job, which will re-read the .hidden file. Or while at it, could be a LRU cache, Qt makes it simple:

    struct CacheHiddenFile {
        QDateTime mtime;
        QSet<QString> listedFiles;
    }
    QCache<QString /*dot hidden file*/, CacheHiddenFile> m_cacheHiddenFiles;

    m_cacheHiddenFiles.setMaxCost(10);
    
This requires making the filesInDotHiddenForDir method not file-static as I previously suggested, but rather a method of KCoreDirLister::Private, which would also have the above member.


- David


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


On Sept. 14, 2014, 7:32 p.m., Bruno Nova wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/119607/
> -----------------------------------------------------------
> 
> (Updated Sept. 14, 2014, 7:32 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.h e6ba2ac 
>   src/core/kcoredirlister.cpp a31d629 
>   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/20140917/b40a38b1/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list