Addsm the ability to filter themes by name by typing in the search line or
whether they use the current color scheme or if they are light or dark if they
do not. To enable this the model is extracted out into its own class and a
QSortFilterProxyModel is added for the Filtering. This is mostly based on the
same functionality of the Colors KCM and uses the same heuristic to decide if a
theme is light or dark.
Details
Diff Detail
- Repository
- R119 Plasma Desktop
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
kcms/desktoptheme/package/contents/ui/main.qml | ||
---|---|---|
106 | "Color scheme compatible" is a bit better because it won't get shortened and even if it does, it'll be easier to see what the filter does. |
Some concern here as I tested the patch. The filter is working but the implementation breaks some functionality.
- At initialization, the current theme is not selected in the grid view.
- When settings a theme for deletion, it does not activate the apply button and the theme is no longer greyed out in the grid view.
kcms/desktoptheme/kcm.cpp | ||
---|---|---|
72 | Should connect to KCMDesktopTheme::settingsChanged slot to request ManagedConfigModule to reassess isSaveNeeded(). | |
313 | Why removing this ? It is necessary for ManagedConfigModule to enable the apply button when items are marked for deletion. |
Curious every issue you describe works for me. It would surprise me because the relevant code should be copied as is from the colors kcm.
I don't know what I just tested but you are right it doesn't work.
I can confirm these issue are fixed.
Still one concern, when setting an item for pending deletion, it moves the current index to the next item after the one marked for deletion. See the attachement below.
Current style is Breeze Dark, I want to delete Nordic style.
Once marked for deletion, Oxygen style is now selected
- Only move to the next theme if the current selected one is marked for deletion
FYI I could spot this same bug in the colors kcm. Will fix after this
kcms/desktoptheme/filterproxymodel.cpp | ||
---|---|---|
111 | Ditto | |
kcms/desktoptheme/filterproxymodel.h | ||
62 | s/source_row/sourceRow/ same for source_parent | |
kcms/desktoptheme/package/contents/ui/ThemePreview.qml | ||
180 | Better use === with this bloody javascript | |
kcms/desktoptheme/themesmodel.cpp | ||
162 | A ref on a temporary sounds like a bad idea to me. | |
166 | Don't use Q_FOREACH but a proper for in new code | |
174 | qAsConst(themes) | |
238 | qAsConst(m_data) | |
kcms/desktoptheme/themesmodel.h | ||
66 | This one and the two following are missing the default values for their parameters (which parents have, I wish override would check for that too). |
kcms/desktoptheme/themesmodel.cpp | ||
---|---|---|
238 | Not strictly speaking indeed. Now C++ being what it is you're never safe of someone introducing a member as mutable though. ;-) |