D27724: Syncronise setNeedsSave between KCModule and ConfigModule in both directions
David Edmundson
noreply at phabricator.kde.org
Fri Feb 28 16:06:03 GMT 2020
davidedmundson created this revision.
Herald added a project: Frameworks.
Herald added a subscriber: kde-frameworks-devel.
davidedmundson requested review of this revision.
REVISION SUMMARY
The problem occurs in the following situation:
Widgets and such often change state and emit they're changed on the
initial load. This is typically a bug, but easy to hit and hard to find.
To resolve this KCModule::showEvent() queues up a
KCModule::changed(false) after loading. It hides the problem for
widgets.
This ends up causing a bigger problem for the QML side.
If during load ConfigModule::setNeedsSave(true) is called we set
d->_needsSave to true
We emit ConfigModule::changed(true) which we proxy through to
KCModule::changed(true)
We then process the queued KCModule::setChanged(false) from the earlier
KCModule::showEvent so we disable the button
But problematically any subsequent changes in the KCM which call
ConfigModule::setNeedsSave(true) now no-op and don't get proxied.
This patch resolves the issue by keeping the syncronisation between
KCModule and ConfigModule working in both directions.
It is an alternative to D27452 <https://phabricator.kde.org/D27452>. It's not as neat but it's safer.
REPOSITORY
R295 KCMUtils
BRANCH
master
REVISION DETAIL
https://phabricator.kde.org/D27724
AFFECTED FILES
src/kcmoduleqml.cpp
To: davidedmundson
Cc: kde-frameworks-devel, LeGast00n, cblack, GB_2, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20200228/9312089d/attachment-0001.html>
More information about the Kde-frameworks-devel
mailing list