[digikam] [Bug 334633] New: Album metadata sorted in non-deterministic way in some cases

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

[digikam] [Bug 334633] New: Album metadata sorted in non-deterministic way in some cases

Michal Sylwester
https://bugs.kde.org/show_bug.cgi?id=334633

            Bug ID: 334633
           Summary: Album metadata sorted in non-deterministic way in some
                    cases
    Classification: Unclassified
           Product: digikam
           Version: 4.0.0
          Platform: Compiled Sources
                OS: Linux
            Status: UNCONFIRMED
          Severity: minor
          Priority: NOR
         Component: Metadata
          Assignee: [hidden email]
          Reporter: [hidden email]

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".

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[digikam] [Bug 334633] Album metadata sorted in non-deterministic way in some cases

Gilles Caulier-4
https://bugs.kde.org/show_bug.cgi?id=334633

Gilles Caulier <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]
          Component|Metadata                    |Filters

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[digikam] [Bug 334633] Album metadata sorted in non-deterministic way in some cases

Gilles Caulier-4
In reply to this post by Michal Sylwester
https://bugs.kde.org/show_bug.cgi?id=334633

--- Comment #1 from Gilles Caulier <[hidden email]> ---
Mohamed,

New entry from Michal, relevant of AlbumFilter implementation

Gilles Caulier

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[digikam] [Bug 334633] Album metadata sorted in non-deterministic way in some cases

Gilles Caulier-4
In reply to this post by Michal Sylwester
https://bugs.kde.org/show_bug.cgi?id=334633

Gilles Caulier <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
   Version Fixed In|                            |4.1.0
         Resolution|---                         |FIXED

--- Comment #2 from Gilles Caulier <[hidden email]> ---
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))
     {

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[digikam] [Bug 334633] Album metadata sorted in non-deterministic way in some cases

Gilles Caulier-4
In reply to this post by Michal Sylwester
https://bugs.kde.org/show_bug.cgi?id=334633

--- Comment #3 from Gilles Caulier <[hidden email]> ---
Mohamed, please use "BUG: xxxxxx" macro ALONE to close file automatically, not
"Fixing ...."

Gilles Caulier

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[digikam] [Bug 334633] Album metadata sorted in non-deterministic way in some cases

Mohamed
In reply to this post by Michal Sylwester
https://bugs.kde.org/show_bug.cgi?id=334633

--- Comment #4 from Mohamed <[hidden email]> ---
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 !

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[digikam] [Bug 334633] Album metadata sorted in non-deterministic way in some cases

Gilles Caulier-4
In reply to this post by Michal Sylwester
https://bugs.kde.org/show_bug.cgi?id=334633

--- Comment #5 from Gilles Caulier <[hidden email]> ---
CC is sent using "BUG: xxxxx" macro alone...

Gilles

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel