Summary: | Sorting by name does not work as expected when some entry contains accented character | ||
---|---|---|---|
Product: | [Applications] kmenuedit | Reporter: | Patrick Silva <bugseforuns> |
Component: | general | Assignee: | Unassigned bugs mailing-list <unassigned-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | kde.jen6 |
Priority: | NOR | Keywords: | junior-jobs |
Version: | 5.15.0 | ||
Target Milestone: | --- | ||
Platform: | Arch Linux | ||
OS: | Linux | ||
Latest Commit: | https://commits.kde.org/kmenuedit/fb171dff39c7976d8891b6c9a848857439e660ff | Version Fixed In: | 5.16.0 |
Sentry Crash Report: | |||
Attachments: |
screen recording of kmenuedit
screenshot - Dolphin sorts files/folders by name as expected After patch sort result |
Created attachment 118107 [details]
screenshot - Dolphin sorts files/folders by name as expected
https://cgit.kde.org/kmenuedit.git/tree/treeview.cpp#n144 shows the comparison is made using the QString::operator<(), which according to https://doc.qt.io/qt-5/qstring.html#querying-string-data is not locale-aware, and should be replaced with QString::localeAwareCompare(). Hi I made an path based on Comment 2. Please review it. https://phabricator.kde.org/D20386 Created attachment 119301 [details]
After patch sort result
Git commit fb171dff39c7976d8891b6c9a848857439e660ff by Christoph Feck, on behalf of Geon Son. Committed on 25/04/2019 at 19:41. Pushed by cfeck into branch 'master'. Fix sorting to use locale-aware comparisons In TreeItem, there are two compare functions, itemNameLessThan() and itemDescriptionLessThan(). These two functions were using < operator to compare strings, which does not consider the user's locale. So change compare function to QString::localeAwareCompare() TEST PLAN Based on bug attachment, I add the Á and A to test it. FIXED-IN: 5.16.0 Differential Revision: https://phabricator.kde.org/D20386 M +4 -4 treeview.cpp https://commits.kde.org/kmenuedit/fb171dff39c7976d8891b6c9a848857439e660ff |
Created attachment 118106 [details] screen recording of kmenuedit SUMMARY Watch the screen recording please. "Área de trabalho..." appears after "Kavantum Manager" after I sort the entries by name. kmenuedit should sort the entries by name like Dolphin does with files/folders. Operating System: Arch Linux KDE Plasma Version: 5.15.0 KDE Frameworks Version: 5.55.0 Qt Version: 5.12.1