D29115: Add option to show hidden files and folders last

Gaston Haro noreply at phabricator.kde.org
Wed Feb 3 23:26:25 GMT 2021


harogaston added a comment.


  Hi all!
  
  Unfortunately I'm not finding time to do this properly. I tried but my machine has changed and seems that I cannot compile and test the projects anymore.
  I'll have to look into that eventually but I certainly cannot do it now.
  
  Given the latest feedback this is all there is to change I believe:
  
    diff --git a/src/kitemviews/kfileitemmodel.cpp b/src/kitemviews/kfileitemmodel.cpp
    index dbbd63a6a..fe502fbb3 100644
    --- a/src/kitemviews/kfileitemmodel.cpp
    +++ b/src/kitemviews/kfileitemmodel.cpp
    @@ -1713,6 +1713,15 @@ bool KFileItemModel::lessThan(const ItemData* a, const ItemData* b, const QColla
             }
         }
    
    +    // Show hidden files and folders last
    +    const bool isHiddenA = a->item.isHidden();
    +    const bool isHiddenB = b->item.isHidden();
    +    if (isHiddenA && !isHiddenB) {
    +        return false;
    +    } else if (!isHiddenA && isHiddenB) {
    +        return true;
    +    }
    +
         if (m_sortDirsFirst || m_sortRole == SizeRole) {
             const bool isDirA = a->item.isDir();
             const bool isDirB = b->item.isDir();
  
  If anyone can push that change upstream, via Gitlab or any other means please fell free.
  
  Sorry about the inconvenience.
  
  Best,
  
  Gastón

REPOSITORY
  R318 Dolphin

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

To: harogaston, #dolphin, ngraham, elvisangelaccio
Cc: meven, kfm-devel, badbunny, waitquietly, azyx, nikolaik, pberestov, iasensio, aprcela, fprice, fbampaloukas, alexde, Codezela, feverfew, spoorun, navarromorales, firef, ngraham, andrebarros, emmanuelp, rdieter, mikesomov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kfm-devel/attachments/20210203/0772b5c2/attachment.htm>


More information about the kfm-devel mailing list