<table><tr><td style="">davidedmundson created this revision.<br />Herald added a project: Frameworks.<br />Herald added a subscriber: kde-frameworks-devel.<br />davidedmundson requested review of this revision.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D27724">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>The problem occurs in the following situation:</p>
<p>Widgets and such often change state and emit they're changed on the<br />
initial load. This is typically a bug, but easy to hit and hard to find.</p>
<p>To resolve this KCModule::showEvent() queues up a<br />
KCModule::changed(false) after loading. It hides the problem for<br />
widgets.</p>
<p>This ends up causing a bigger problem for the QML side.</p>
<p>If during load ConfigModule::setNeedsSave(true) is called we set<br />
d->_needsSave to true<br />
We emit ConfigModule::changed(true) which we proxy through to<br />
KCModule::changed(true)</p>
<p>We then process the queued KCModule::setChanged(false) from the earlier<br />
KCModule::showEvent so we disable the button</p>
<p>But problematically any subsequent changes in the KCM which call<br />
ConfigModule::setNeedsSave(true) now no-op and don't get proxied.</p>
<p>This patch resolves the issue by keeping the syncronisation between<br />
KCModule and ConfigModule working in both directions.</p>
<p>It is an alternative to <a href="https://phabricator.kde.org/D27452" style="background-color: #e7e7e7;
border-color: #e7e7e7;
border-radius: 3px;
padding: 0 4px;
font-weight: bold;
color: black;text-decoration: none;">D27452</a>. It's not as neat but it's safer.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R295 KCMUtils</div></div></div><br /><div><strong>BRANCH</strong><div><div>master</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D27724">https://phabricator.kde.org/D27724</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>src/kcmoduleqml.cpp</div></div></div><br /><div><strong>To: </strong>davidedmundson<br /><strong>Cc: </strong>kde-frameworks-devel, LeGast00n, cblack, GB_2, michaelh, ngraham, bruns<br /></div>