Bug 470350 - Alphabetical ordering - Why _ is before . ?
Summary: Alphabetical ordering - Why _ is before . ?
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Albums-ItemsSort (other bugs)
Version First Reported In: 8.0.0
Platform: Arch Linux Linux
: NOR wishlist
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-05-28 09:34 UTC by lucanakin
Modified: 2023-05-28 12:07 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 8.1.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description lucanakin 2023-05-28 09:34:20 UTC
SUMMARY 

When pictures are alphabetically ordered, the "_" comes before the "." 
Maybe it should be "." before "_" ?
It leads to strange ordering :

OBSERVED RESULT :
Photo1_v2.jpg
Photo1_v3.jpg
Photo1.jpg
Photo1foo.jpg

EXPECTED RESULT :
Maybe it should be :

Photo1.jpg
Photo1_v2.jpg
Photo1_v3.jpg
Photo1foo.jpg

What do you think ?

SOFTWARE/OS VERSIONS
Linux:  MANJARO with Cinammon desktop
DIGIKAM : 8.0.0
Comment 1 Maik Qualmann 2023-05-28 09:56:37 UTC
Hmm, that's a good question. We have a special case for sorting in the code for versioning with the "_v" part and actually expect this order:

Photo1.jpg
Photo1_v2.jpg
Photo1_v3.jpg

That has been the case so far. I see that Dolphin has the same sorting as digiKam, which makes me wonder.
I'm checking if there was a change in Qt.

Maik
Comment 2 lucanakin 2023-05-28 10:02:06 UTC
I am sorry, I didnot really test with "_v1", "_v2", "_v3", it was a "foo" example.

In reality, my case is for all other words :

What I have : 
Photo1_developpement1.jpg
Photo1_black&white.jpg
Photo1.jpg
Photo1test.jpg

should be :
Photo1.jpg
Photo1_developpement1.jpg
Photo1_black&white.jpg
Photo1test.jpg
Comment 3 lucanakin 2023-05-28 10:03:56 UTC
***

Photo1_black&white.jpg
Photo1_developpement1.jpg
Photo1.jpg
Photo1test.jpg

should be :

Photo1.jpg
Photo1_black&white.jpg
Photo1_developpement1.jpg
Photo1test.jpg
Comment 4 Maik Qualmann 2023-05-28 11:43:17 UTC
Git commit 3db3d0bc3a4a5a8c53c52d3ff1cf5a4da616e07e by Maik Qualmann.
Committed on 28/05/2023 at 11:42.
Pushed by mqualmann into branch 'master'.

fix normal sorting mode
FIXED-IN: 8.1.0

M  +1    -1    NEWS
M  +19   -9    core/libs/database/models/itemsortcollator.cpp

https://invent.kde.org/graphics/digikam/-/commit/3db3d0bc3a4a5a8c53c52d3ff1cf5a4da616e07e
Comment 5 Maik Qualmann 2023-05-28 11:50:53 UTC
In order to achieve the desired result, you must set the character string comparison from "Natural" to "Normal" in the upcoming digiKam 8.1.0 in the digiKam settings under Miscellaneous.

https://docs.digikam.org/en/setup_application/miscs_settings.html#behavior-settings

The result in the "Natural" mode is identical to Dolphin, only with the normal character string comparison do you get the desired order in Dolphin or 
digiKam. Note that in "Normal" mode you lose the numerical comparison, as Photo10.jpg will be ahead of Photo9.jpg. This is also identical to Dolphin in "Normal" mode.

Maik
Comment 6 lucanakin 2023-05-28 12:07:03 UTC
Ok, thank you very much Mr Qualmann !

I had the same behaviour (_ before .) with both natural and normal modes in Digikam 8.0.0.
I will wait for 8.1.0 ! :-)