Separate directories and archives when sorting by date

Authored by rkflx on Jun 25 2018, 9:49 PM.

Description

Separate directories and archives when sorting by date

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 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 Browse mode, sort a directory containing directories, archives
and images by Date and check the correct grouping (also for
Descending).

Reviewers: Gwenview, muhlenpfordt

Reviewed By: Gwenview, muhlenpfordt

Subscribers: muhlenpfordt, faridb

Differential Revision: https://phabricator.kde.org/D13728

Details

Committed
rkflxJun 28 2018, 9:59 AM
Reviewer
Gwenview
Differential Revision
D13728: Separate directories and archives when sorting by date
Parents
R260:dfcbaa30c3a6: Fix sorting by date in some situations
Branches
Unknown
Tags
Unknown