<table><tr><td style="">davidedmundson added a comment.
</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/D27384">View Revision</a></tr></table><br /><div><div><blockquote style="border-left: 3px solid #a7b5bf; color: #464c5c; font-style: italic; margin: 4px 0 12px 0; padding: 4px 12px; background-color: #f8f9fc;"><p>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.</p></blockquote>
<p>Aha! What a weird bit of code.</p>
<p>so I think I see what happens:</p>
<ol class="remarkup-list">
<li class="remarkup-list-item">KCModule::showEvent()</li>
<li class="remarkup-list-item">this queues up a load and queues up a KCModule::changed(false)</li>
</ol>
<ol class="remarkup-list" start="3">
<li class="remarkup-list-item">during load ConfigModule::setNeedsSave(true) is called we set d->_needsSave to true</li>
<li class="remarkup-list-item">we emit ConfigModule::changed(true) which we proxy through to KCModule::changed(true)</li>
</ol>
<ol class="remarkup-list" start="5">
<li class="remarkup-list-item">we then process the queued KCModule::setChanged(false) from the earlier KCModule::showEvent</li>
<li class="remarkup-list-item">so we disable the button</li>
</ol>
<ol class="remarkup-list" start="7">
<li class="remarkup-list-item">any subsequent changes in the KCM will call ConfigModule::setNeedsSave(true)</li>
</ol>
<p>but this now matches d->_needsSave so it no-ops. Even though KCModule is out of sync.</p>
<p>Systemsettings only knows what KCModule signals, not ConfigModule.</p>
<p>This patch resets ConfigModule::d->_needsSave after step 3</p>
<hr class="remarkup-hr" />
<p>In the morning can you confirm that commenting out the return in</p>
<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">void ConfigModule::setNeedsSave(bool needs)
{
if (needs == d->_needsSave) {
return;
}</pre></div>
<p>also fixes it.</p>
<p>If so, I understand it all, and will happily approve this patch.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R119 Plasma Desktop</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D27384">https://phabricator.kde.org/D27384</a></div></div><br /><div><strong>To: </strong>bport, Plasma, broulik, ervin, crossi, meven, ngraham, davidedmundson, The-Feren-OS-Dev<br /><strong>Cc: </strong>The-Feren-OS-Dev, plasma-devel, Orage, LeGast00n, cblack, jraleigh, zachus, fbampaloukas, GB_2, ragreen, ZrenBot, ngraham, alexeymin, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, ahiemstra, mart<br /></div>