<table><tr><td style="">broulik created this revision.<br />broulik added reviewers: Frameworks, dfaure, aacid.<br />Herald added a project: Frameworks.<br />Herald added a subscriber: kde-frameworks-devel.<br />broulik 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/D22523">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>KMainWindow compresses saving its configuration by a 500ms timer. However, for <tt style="background: #ebebeb; font-size: 13px;">QDockWidget</tt> <tt style="background: #ebebeb; font-size: 13px;">visibilityChanged</tt> a direct connection to the <tt style="background: #ebebeb; font-size: 13px;">setSettingsDirty</tt> method is made, which immediately saves settings.<br />
Since there is already an <tt style="background: #ebebeb; font-size: 13px;">eventFilter</tt> also listening for <tt style="background: #ebebeb; font-size: 13px;">QEvent::Show</tt> and <tt style="background: #ebebeb; font-size: 13px;">QEvent::Hide</tt>, the connection to <tt style="background: #ebebeb; font-size: 13px;">visibilityChanged</tt> is redundant since that signal is emitted from the respective event handler anyway.<br />
The main benefit is that the <tt style="background: #ebebeb; font-size: 13px;">eventFilter</tt> code compresses the configuration save, not jeopardizing startup time for applications with lots of dock widgets like Dolphin.</p></div></div><br /><div><strong>TEST PLAN</strong><div><p>Noticed that Dolphin repeatedly saved its configuration on startup, found this. <br />
Previously it did 4 save calls (probably for every <tt style="background: #ebebeb; font-size: 13px;">QDockWidget</tt> added) and then another queued one after startup was finished.<br />
With this patch it only does a save call shortly after startup has completed. <br />
Unittests still pass. Manually hiding dock widgets still has its configuration saved, albeit slightly delayed to before.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R263 KXmlGui</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D22523">https://phabricator.kde.org/D22523</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>src/kmainwindow.cpp</div></div></div><br /><div><strong>To: </strong>broulik, Frameworks, dfaure, aacid<br /><strong>Cc: </strong>kde-frameworks-devel, LeGast00n, sbergeron, michaelh, ngraham, bruns<br /></div>