Bug 462857

Summary: Changing a font, then changing it back to default, still shows it highlighted as changed
Product: [Applications] systemsettings Reporter: John Veness <john.kde>
Component: kcm_fontsAssignee: Plasma Bugs List <plasma-bugs-null>
Status: CONFIRMED ---    
Severity: normal CC: jackhill3103, nate
Priority: NOR    
Version First Reported In: 5.26.4   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description John Veness 2022-12-10 16:49:28 UTC
STEPS TO REPRODUCE
1. Open System Settings
2. Make sure in Sidebar View (in order to obtain the Highlight Changed Settings button)
3. Browse to Appearance, Fonts
4. Change one of the fonts, e.g. change Menu font to Latin Modern Roman size 12
5. Click Apply
6. Click Defaults
7. Click Apply
8. Enable "Highlight Changed Settings"
9. Move to a different KCM (e.g. Icons) then back to Fonts, to refresh it

OBSERVED RESULT
The Menu font will be highlighted as changed.

EXPECTED RESULT
The Menu font will not be highlighted as changed.

SOFTWARE/OS VERSIONS
Operating System: openSUSE Tumbleweed 20221209
KDE Plasma Version: 5.26.4
KDE Frameworks Version: 5.100.0
Qt Version: 5.15.7
Kernel Version: 6.0.10-1-default (64-bit)
Graphics Platform: X11
Processors: 4 × Intel® Core™ i5-7200U CPU @ 2.50GHz
Memory: 15.5 GiB of RAM
Graphics Processor: Mesa Intel® HD Graphics 620
Manufacturer: HP
Product Name: HP ProBook 450 G4

ADDITIONAL INFORMATION
I notice that ~/.config/kdeglobals contains "menuFont=Noto Sans,10,-1,5,50,0,0,0,0,0" after doing the steps to reproduce. Deleting that line removes the changed highlight from the KCM. So it seems to me that the KCM is writing this line into ~/.config/kdeglobals after pressing Defaults, when really it should delete the line from ~/.config/kdeglobals.

Alternatively, the system that notices that settings have been changed should be able to cope with the entry in ~/.config/kdeglobals being the same as the default, and so not highlighting it as changed.
Comment 1 Nate Graham 2023-01-03 21:11:52 UTC
> So it seems to me that the KCM is writing this line into ~/.config/kdeglobals after pressing Defaults,
> when really it should delete the line from ~/.config/kdeglobals
Yep!

> Alternatively, the system that notices that settings have been changed should be able to cope with the
> entry in ~/.config/kdeglobals being the same as the default, and so not highlighting it as changed.
Maybe... technically these are not exactly the same thing, even though from the user's perspective they are identical. The difference is that when an entry is present that happens to match the default setting, any changes to the system's default value for that setting will not be applied automatically.