Bug 368600

Summary: GTK Application Style cursors/icons themes lists should be in alphabetical order
Product: [Applications] systemsettings Reporter: Patrick Silva <bugseforuns>
Component: kcm_gtkAssignee: Aleix Pol <aleixpol>
Status: RESOLVED FIXED    
Severity: normal CC: nate, wbauer1
Priority: NOR    
Version First Reported In: 5.13.5   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In: 5.14.0
Sentry Crash Report:
Attachments: cursors list
icons themes list
alternative icons themes list
screenshot taken on Arch, plasma 5.13.3
R comes before O in plasma 5.14 beta, Arch Linux
cursor drop down in plasma 5.13.5

Description Patrick Silva 2016-09-11 17:49:37 UTC
When user has a long list of cursors/icons themes is hard to find desired themes because the lists are not in alphabetical order. See the screenshots please.

Reproducible: Always


Actual Results:  
Lists are not in alphabetical order.

Expected Results:  
Lists in alphabetical order.
Comment 1 Patrick Silva 2016-09-11 17:51:47 UTC
Created attachment 101038 [details]
cursors list
Comment 2 Patrick Silva 2016-09-11 17:53:20 UTC
Created attachment 101039 [details]
icons themes list
Comment 3 Patrick Silva 2016-09-11 17:53:53 UTC
Created attachment 101040 [details]
alternative icons themes list
Comment 4 Aleix Pol 2018-07-03 16:01:50 UTC
Git commit 7b56c23870798adbeb3f110eacae7f1020dcad6f by Aleix Pol.
Committed on 03/07/2018 at 15:44.
Pushed by apol into branch 'Plasma/5.13'.

Keep Cursor and Icon themes lists sorted

M  +2    -0    src/cursorthemesmodel.cpp
M  +2    -0    src/iconthemesmodel.cpp

https://commits.kde.org/kde-gtk-config/7b56c23870798adbeb3f110eacae7f1020dcad6f
Comment 5 Patrick Silva 2018-07-12 00:16:18 UTC
Created attachment 113891 [details]
screenshot taken on Arch, plasma 5.13.3

unfortunately it's not fixed in plasma 5.13.3, Arch Linux.
Comment 6 Wolfgang Bauer 2018-09-14 19:20:55 UTC
(In reply to Dr. Chapatin from comment #5)
> Created attachment 113891 [details]
> screenshot taken on Arch, plasma 5.13.3
> 
> unfortunately it's not fixed in plasma 5.13.3, Arch Linux.

It actually is sorted, but the sorting is case-sensitive, i.e. 'a' comes after 'Z'.
Comment 7 Patrick Silva 2018-09-14 19:39:27 UTC
Created attachment 114964 [details]
R comes before O in plasma 5.14 beta, Arch Linux
Comment 8 Wolfgang Bauer 2018-09-14 19:44:52 UTC
(In reply to Dr. Chapatin from comment #7)
> Created attachment 114964 [details]
> R comes before O in plasma 5.14 beta, Arch Linux

That's likely because the fix never was merged to master, it only was in the 5.13 branch.
Has been fixed an hour ago though.
Comment 9 Patrick Silva 2018-09-14 19:46:23 UTC
Plasma 5.13.5 had the same bug.
Comment 10 Wolfgang Bauer 2018-09-14 19:52:05 UTC
(In reply to Dr. Chapatin from comment #9)
> Plasma 5.13.5 had the same bug.

Which one?

On your screenshot from 5.13.3 the only problem that can be seen is that the search is case-sensitive.(O->P->e)
And that's what I see here with 5.13.5 too.

In 5.14 beta it probably is completely unsorted though, but current 5.14 branch should be in the same state as 5.13.5.
Comment 11 Patrick Silva 2018-09-14 19:57:12 UTC
Plasma 5.13.5 had the same bug shown in the screenshot from comment 7.
Comment 12 Wolfgang Bauer 2018-09-14 20:10:18 UTC
(In reply to Dr. Chapatin from comment #11)
> Plasma 5.13.5 had the same bug shown in the screenshot from comment 7.

All right, that's the (GTK2) theme list though.

I only looked at the cursors and icon-themes list as the title of this bug report says, and the commit from comment#4 was supposed to fix.

Although, the themes lists seem to be correctly sorted here too (even case-insensitive), may be just "luck" though.
Comment 13 Patrick Silva 2018-09-14 20:31:54 UTC
Created attachment 114966 [details]
cursor drop down in plasma 5.13.5

Sorting must be case-insensitive.
Comment 14 Wolfgang Bauer 2018-09-14 21:02:47 UTC
(In reply to Dr. Chapatin from comment #13)
> Created attachment 114966 [details]
> cursor drop down in plasma 5.13.5
> 
> Sorting must be case-insensitive.

I agree that it should be case-insensitive, but let's summarize the current state to avoid confusion.

So, as I see it:

The icon and cursor themes list are sorted now (not in 5.14 beta because the fix got "lost", that's fixed in 5.14 branch too meanwhile).
But they are sorted case-sensitive (i.e. 'a' comes after 'Z', not before 'B'), it should rather be case-insensitive.

The GTK2/3 themes lists are apparently still not sorted and appear in the order they are in the directory list.
Comment 15 Patrick Silva 2018-09-14 21:08:35 UTC
Right. Thank you for your help.
Comment 16 Nate Graham 2018-09-19 04:28:20 UTC
This patch oughta fix that right up: https://phabricator.kde.org/D15598
Comment 17 Nate Graham 2018-09-20 15:25:55 UTC
Git commit b943d4ac6e2c75214e24c7d7e352d54e08181ddd by Nathaniel Graham.
Committed on 20/09/2018 at 15:25.
Pushed by ngraham into branch 'master'.

Sort icon and cursor themes case-insensitively

Summary:
Stick a QSortFilterProxyModel between the model and the view, and tell it to sort case-insensitively. Thanks to https://stackoverflow.com/a/5732026/2934226 for providing the solution.
FIXED-IN: 5.14.0

Test Plan: Could not test as I was unable to locate a working GTK 2 or 3 theme that started with a lowercase letter. But theoretically this code should do the trick, and it does not appear to cause any regressions at least.

Reviewers: apol, #plasma, broulik

Reviewed By: apol

Subscribers: wbauer, cfeck, broulik, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D15598

M  +0    -2    src/cursorthemesmodel.cpp
M  +16   -3    src/gtkconfigkcmodule.cpp
M  +0    -2    src/iconthemesmodel.cpp

https://commits.kde.org/kde-gtk-config/b943d4ac6e2c75214e24c7d7e352d54e08181ddd
Comment 18 Nate Graham 2018-09-24 22:43:09 UTC
Git commit c44527bb678e160d9c4b8401cc96c4b59072a0f5 by Nathaniel Graham.
Committed on 24/09/2018 at 22:34.
Pushed by ngraham into branch 'Plasma/5.14'.

Sort icon and cursor themes case-insensitively

Summary:
Stick a QSortFilterProxyModel between the model and the view, and tell it to sort case-insensitively. Thanks to https://stackoverflow.com/a/5732026/2934226 for providing the solution.
FIXED-IN: 5.14.0

Test Plan: Could not test as I was unable to locate a working GTK 2 or 3 theme that started with a lowercase letter. But theoretically this code should do the trick, and it does not appear to cause any regressions at least.

Reviewers: apol, #plasma, broulik

Reviewed By: apol

Subscribers: wbauer, cfeck, broulik, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D15598

M  +0    -2    src/cursorthemesmodel.cpp
M  +16   -3    src/gtkconfigkcmodule.cpp
M  +0    -2    src/iconthemesmodel.cpp

https://commits.kde.org/kde-gtk-config/c44527bb678e160d9c4b8401cc96c4b59072a0f5