Bug 477848 - Energy Saving KCM should support non-default settings detection
Summary: Energy Saving KCM should support non-default settings detection
Status: RESOLVED FIXED
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_powerdevil (show other bugs)
Version: 5.90.0
Platform: Arch Linux Linux
: NOR wishlist
Target Milestone: ---
Assignee: Jakob Petsovits
URL:
Keywords: qt6
: 477952 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-12-01 16:19 UTC by Patrick Silva
Modified: 2023-12-09 04:51 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Silva 2023-12-01 16:19:19 UTC
STEPS TO REPRODUCE
1. open Energy Saving KCM
2. apply non-default settings
3. 

OBSERVED RESULT
Energy Saving KCM is not marked with an orange dot, the modified settings are not highlighted in orange

EXPECTED RESULT
Energy Saving KCM detects non-default settings

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 5.90.0
KDE Frameworks Version: 5.246.0
Qt Version: 6.6.1
Graphics Platform: Wayland
Comment 1 Jakob Petsovits 2023-12-01 23:54:56 UTC
A relevant merge request has been started @ https://invent.kde.org/plasma/powerdevil/-/merge_requests/283
Comment 2 Patrick Silva 2023-12-03 02:20:18 UTC
*** Bug 477952 has been marked as a duplicate of this bug. ***
Comment 3 Jakob Petsovits 2023-12-06 03:15:28 UTC
Git commit 1fa7212e69480b8c86408c0ff0bafb268ffe40e7 by Jakob Petsovits.
Committed on 06/12/2023 at 04:02.
Pushed by jpetso into branch 'master'.

Make highlights work for non-default settings in the profiles KCM

The recent QML port didn't implement the code that was required
for this to work. Here's the fix.

Using SettingStateBinding from kcmutils adds highlights to the
components within the QML page.

In order to also make the (non-)defaultIndicator in the sidebar
list view show up, System Settings needs to be able to construct
a single KCModuleData object through the KCM's plugin factory.
We need to register both the KQuickManagedConfigModule and the
KCModuleData when declaring the plugin, so instead of
K_PLUGIN_CLASS_WITH_JSON we now use K_PLUGIN_FACTORY_WITH_JSON.

ProfilesConfigKCM.{h,cpp} requires some refactoring to use a single
KCModuleData object instead of a collection of three different ones.
Instead of the ProfilesConfigKCM class owning three data objects,
it now only constructs a single one which in turn will create and
expose the KConfigXT-generated settings classes for all profiles.

M  +74   -63   kcmodule/profiles/ProfilesConfigKCM.cpp
M  +34   -29   kcmodule/profiles/ProfilesConfigKCM.h
M  +175  -83   kcmodule/profiles/ui/ProfileConfig.qml

https://invent.kde.org/plasma/powerdevil/-/commit/1fa7212e69480b8c86408c0ff0bafb268ffe40e7