Bug 475339 - Sort folders by "natural order"
Summary: Sort folders by "natural order"
Status: RESOLVED FIXED
Alias: None
Product: kphotoalbum
Classification: Applications
Component: general (show other bugs)
Version: 5.11.0
Platform: Ubuntu Linux
: NOR wishlist
Target Milestone: ---
Assignee: KPhotoAlbum Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-10-07 21:00 UTC by Pierre Etchemaïté
Modified: 2023-10-08 17:53 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Folders in lexicographic order (163.04 KB, image/jpeg)
2023-10-07 21:00 UTC, Pierre Etchemaïté
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pierre Etchemaïté 2023-10-07 21:00:46 UTC
Created attachment 162151 [details]
Folders in lexicographic order

Since I'm doing an inventory I have lots of numbered subfolders, and they're not sorted in the most convenient way; One issue is that they're sorted lexicographically instead of using "natural" order. 

STEPS TO REPRODUCE
1. Create subfolders folder-1, folder-2, folder-15. Add images in each
2. Index the whole
3. Browse the indexed result by "Directories"

OBSERVED RESULT
Folders in folder-1, folder-15, folder-2 order

EXPECTED RESULT
Folders in folder-1, folder-2, folder-15 order

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Ubuntu 22.04.3 LTS (not using the KDE desktop, only libs)
KDE Plasma Version: 5.24.7
KDE Frameworks Version: 5.92.0
Qt Version: 5.15.3

ADDITIONAL INFORMATION
kPhotoAlbum v5.11.0-67-g35164270 compiled from sources
Comment 1 Johannes Zarl-Zierl 2023-10-08 11:10:27 UTC
Seems like a reasonable change. I'll take a look...
Comment 2 Johannes Zarl-Zierl 2023-10-08 14:17:15 UTC
Git commit 5f528e40106b7b3a5f3872ec837eb63f54f71347 by Johannes Zarl-Zierl.
Committed on 08/10/2023 at 16:17.
Pushed by johanneszarl into branch 'master'.

Make sort order for Browser configurable.

Add a checkbox in the "configure view" menu to enable/disable natural
sort order, and persist the setting.

M  +6    -0    Browser/BrowserWidget.cpp
M  +10   -2    Browser/BrowserWidget.h
M  +2    -0    CHANGELOG.md
M  +10   -0    MainWindow/Window.cpp
M  +1    -0    MainWindow/Window.h
M  +1    -0    lib/kpabase/SettingsData.cpp
M  +1    -0    lib/kpabase/SettingsData.h

https://invent.kde.org/graphics/kphotoalbum/-/commit/5f528e40106b7b3a5f3872ec837eb63f54f71347
Comment 3 Pierre Etchemaïté 2023-10-08 17:53:33 UTC
Works great, thanks!