Fix sorting by date in some situations
Summary: There are two problems when sorting images by {nav Date}: Since 05f7e069 Gwenview sorts images by shooting date. However, in case two images have the same date or when there is no shooting date available for a file, no appropriate secondary sorting criterion is provided, leading to unexpected sorting results. 8f128306 enabled sorting in {nav Descending} order, but toggling the option does not invert the sorting order for images with the same shooting date. Both problems can be fixed by falling back to a secondary sorting criterion in case of equal shooting dates. For `KDirSortFilterProxyModel::lessThan`, this means sorting by `KDirModel::ModifiedTime` and finally by `KDirModel::Name`. Test Plan: Prepare files containing the same shooting date in their metadata, but having different filesystem timestamps. {nav View > Sort By > Date} should work correctly and toggling {nav Descending} should invert the sorting order. Reviewers: #gwenview, muhlenpfordt Reviewed By: #gwenview, muhlenpfordt Subscribers: muhlenpfordt, faridb Differential Revision: https://phabricator.kde.org/D13727
parent
ef1244b1
Please register or sign in to comment