D7498: Add option to group hidden files and folders at the end

Mark Gaiser noreply at phabricator.kde.org
Sun Aug 27 21:15:53 BST 2017


markg added a comment.


  I'm sorry, but i'm very much against adding this feature.
  It was shot down by the previous maintainer for (in summary) being a really small feature that a _really_ small percentage of the users would be using (if any).
  See Frank's reasoning for closing it as wontfix: https://bugs.kde.org/show_bug.cgi?id=333219
  
  Submitting it now as patch strikes me as weird. It was rejected, not even by complexity but by being a really minor feature that could cause more confusion then clarity.
  
  Also, it will really impact the performance of sorting. Perhaps not in small folders, but hey, you guys know i benchmark with millions of files to stress test so anything that gets added in the lessThan function (which this patch does) will impact performance!
  
  A more acceptable version would be one that does not impact current sorting. That can be done by filtering out the hidden files (which actually would improve sorting), that would be sane as the hidden files would be at the end anyhow.
  Then independently of the rest sort the hidden files. That would - technically - be more OK for me.
  
  At the very least, get this past the current maintainer.
  
  Regarding maintainability. I think you miss the point there.
  The maintainer of dolphin is responsible for maintaining all the code. The occasional contributor (you, me, dozens of others) can add or reduce to that maintainability burden. If we make code simpler, we likely reduce it. If we make it more complex, we add to the maintainability. At first sight there is no or just marginally extra burden. But imagine what would happen if there is a bug somewhere in code that you touched where it isn't immediately evident that your patch caused it (it could just be in the path). That adds to debug complexity and ultimately in maintainability of the code. It doesn't really matter if you stick around for 10 more minutes or 10 years, that would only matter if you were to maintain dolphin.
  
  @Zren your "When a folder is a mount point (usb/hard drive/partition), show progressbar in the "Size" column instead of the number of files it contains." patch on the other hand (in your github fork) does seem quite interesting :)

INLINE COMMENTS

> kfileitemmodel.cpp:1711-1721
> +    if (m_sortHiddenFilesLast) {
> +        const QString textA = a->item.text();
> +        const QString textB = b->item.text();
> +        const bool hiddenFileA = textA.at(0) == QLatin1Char('.');
> +        const bool hiddenFileB = textB.at(0) == QLatin1Char('.');
> +        if (hiddenFileA && !hiddenFileB) {
> +            return false;

This - at the best - influences sorting a little (if the m_sortHiddenFilesLast is false). But if it's on it will impact sorting performance! Something that others tried very hard to improve...

REPOSITORY
  R318 Dolphin

REVISION DETAIL
  https://phabricator.kde.org/D7498

To: Zren, #dolphin
Cc: markg, elvisangelaccio, broulik, #konqueror
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20170827/ffcae159/attachment.htm>


More information about the kfm-devel mailing list