When sorting by metadata it is likely that several albums will have exactly same sorting key (came category or same date). In such case order of such albums is random and changes on every re-sort. Reproducible: Always Steps to Reproduce: 1. Sort albums by metadata (category or date) 2. Make sure there are at least 2 albums with same category/date that are siblings in album tree 3. Expand/collapse a album tree branch to trigger re-sort Actual Results: Albums jump around more or less randomly Expected Results: Albums stay in-place with the branch expanded/collapsed I think it is necessary to add additional sorting key in case of primary key conflict. Sorting by album name is deterministic as duplicate names are not allowed, not so with metadata. My suggestion: make "sort by category/date" mean "sort by category/date, then by album name".
Mohamed, New entry from Michal, relevant of AlbumFilter implementation Gilles Caulier
Git commit 64c44af9f6f2f0f172e12ca8f718b4acedb6dcc2 by Mohamed Anwer. Committed on 12/05/2014 at 21:00. Pushed by mohamedanwer into branch 'master'. Fixing CCBUG:334633 M +6 -0 libs/models/albumfiltermodel.cpp http://commits.kde.org/digikam/64c44af9f6f2f0f172e12ca8f718b4acedb6dcc2 diff --git a/libs/models/albumfiltermodel.cpp b/libs/models/albumfiltermodel.cpp index 9ec3a77..4ff57ce 100644 --- a/libs/models/albumfiltermodel.cpp +++ b/libs/models/albumfiltermodel.cpp @@ -372,6 +372,12 @@ bool AlbumFilterModel::lessThan(const QModelIndex& left, const QModelIndex& righ QVariant valRight = dataForCurrentSortRole(right); AlbumSettings::StringComparisonType strComparisonType = AlbumSettings::instance()->getStringComparisonType(); + AlbumSettings::AlbumSortOrder role = AlbumSettings::instance()->getAlbumSortOrder(); + + if((role == AlbumSettings::ByDate || role == AlbumSettings::ByCategory)&&(valLeft == valRight)) + { + return QSortFilterProxyModel::lessThan(left, right); + } if((valLeft.type() == QVariant::String) && (valRight.type() == QVariant::String)) {
Mohamed, please use "BUG: xxxxxx" macro ALONE to close file automatically, not "Fixing ...." Gilles Caulier
I tried to CC the commit to tell Mr Michal about the commit, and test the implementation then closing the entry. But it didn't send a CC !
CC is sent using "BUG: xxxxx" macro alone... Gilles