This will resolve a bug (apply never enabled). Bug occurs (at least) when kdeglobals contains QFont serialization without styleName (old style)
BUG: 416358
FIXED-IN: 5.18.1
This will resolve a bug (apply never enabled). Bug occurs (at least) when kdeglobals contains QFont serialization without styleName (old style)
BUG: 416358
FIXED-IN: 5.18.1
Automatic diff as part of commit; lint not applicable. |
Automatic diff as part of commit; unit tests not applicable. |
Started building plasma-desktop over here on an affected machine with this diff applied
I can confirm this fixes the bug - apply now becomes sensitive when changing a setting in Fonts
Other people are confirming that this patch also fixes the issue:
https://bugs.kde.org/show_bug.cgi?id=416358
I still don't fully understand the bug and the fix
So what we're saying is:
Something changes us to needs save early on startup
We emit changed early
That gets lost (?)
So we have to reset back to unchanged after loading so that future changes will enable the apply button?
In case it makes any more sense: The bug made Fonts KCM never indicate that unsaved changes have been made, meaning you can never Apply any changes since it doesn't think anything was changed that is now pending being applied. Apply is always insensitive. This patch however fixes that for me and others who were affected by this issue.
@davidedmundson
We have 2 bugs :
About KCModuleQML didn't investigate a lot but KCModule (parent class) emit a changed false on showEvent (the way the handle to set need save to false. On qml side we use directly stNeedsSave (you can look at save method implementation), so a proper fix can be to add "d->configModule->setNeedsSave(false);" after loading
About KCModuleQML didn't investigate a lot but KCModule (parent class) emit a changed false on showEvent (the way the handle to set need save to false.
Aha! What a weird bit of code.
so I think I see what happens:
but this now matches d->_needsSave so it no-ops. Even though KCModule is out of sync.
Systemsettings only knows what KCModule signals, not ConfigModule.
This patch resets ConfigModule::d->_needsSave after step 3
In the morning can you confirm that commenting out the return in
void ConfigModule::setNeedsSave(bool needs) { if (needs == d->_needsSave) { return; }
also fixes it.
If so, I understand it all, and will happily approve this patch.
Yes emiting signal from setNeedsSave in all case fix stuff too
So this patch is here to solve for "short term"
In more long term we need to fix ConfigModule do you think is better to do a setNeedsSave(false) after loading or emiting signal in all case ?
I can confirm the patch fix the issue.
Tested with
[General] font=Noto Sans,10,-1,5,50,0,0,0,0,0
in .config/kdeglobals
With and without the patch, and the apply button now is highlighted when it the font setting was changed and the setting is saved and applied on Apply
In more long term we need to fix ConfigModule do you think is better to do a setNeedsSave(false) after loading or emiting signal in all case ?
I think we need something, I've seen some similar report in the nightmode KCM about the apply button.
I would personally say the right thing is to remove this line:
QMetaObject::invokeMethod(this, "changed", Qt::QueuedConnection, Q_ARG(bool, false));
As I don't see what it is trying to do