Skip to content
  • rk flx's avatar
    Separate directories and archives when sorting by date · a4c37358
    rk flx authored
    Summary:
    In general, Gwenview sorts directories first, then groups all archives
    behind those and finally displays images. While the separation of images
    worked fine when sorting by {nav Date}, directories and archives were
    mistakenly mixed within a single group for that sorting order.
    
    This is because the special handling for `KDirModel::ModifiedTime` in
    `SortedDirModel::lessThan` does not take into account
    `KDirSortFilterProxyModel::sortFoldersFirst()`. As directories cannot
    come with a shooting date, we can delegate sorting to
    `KDirSortFilterProxyModel::lessThan` which handles the separation of
    directories just fine.
    
    For `SemanticInfoDirModel::RatingRole` the problem could not be
    observed, because  Gwenview did not pass on the rating of directories,
    so both directories being compared had a zero rating and we fell back to
    KDirSortFilterProxyModel::lessThan. Nevertheless, for clarity we make
    the fallback for sorting by rating explicit too.
    
    Depends on D13727
    
    Test Plan:
    In {nav Browse} mode, sort a directory containing directories, archives
    and images by {nav Date} and check the correct grouping (also for
    {nav Descending}).
    
    Reviewers: #gwenview, muhlenpfordt
    
    Reviewed By: #gwenview, muhlenpfordt
    
    Subscribers: muhlenpfordt, faridb
    
    Differential Revision: https://phabricator.kde.org/D13728
    a4c37358