D22523: Remove visibilityChanged connection in favor of existing eventFilter

Kai Uwe Broulik noreply at phabricator.kde.org
Thu Jul 18 09:10:26 BST 2019


broulik created this revision.
broulik added reviewers: Frameworks, dfaure, aacid.
Herald added a project: Frameworks.
Herald added a subscriber: kde-frameworks-devel.
broulik requested review of this revision.

REVISION SUMMARY
  KMainWindow compresses saving its configuration by a 500ms timer. However, for `QDockWidget` `visibilityChanged` a direct connection to the `setSettingsDirty` method is made, which immediately saves settings.
  Since there is already an `eventFilter` also listening for `QEvent::Show` and `QEvent::Hide`, the connection to `visibilityChanged` is redundant since that signal is emitted from the respective event handler anyway.
  The main benefit is that the `eventFilter` code compresses the configuration save, not jeopardizing startup time for applications with lots of dock widgets like Dolphin.

TEST PLAN
  Noticed that Dolphin repeatedly saved its configuration on startup, found this. 
  Previously it did 4 save calls (probably for every `QDockWidget` added) and then another queued one after startup was finished.
  With this patch it only does a save call shortly after startup has completed. 
  Unittests still pass. Manually hiding dock widgets still has its configuration saved, albeit slightly delayed to before.

REPOSITORY
  R263 KXmlGui

REVISION DETAIL
  https://phabricator.kde.org/D22523

AFFECTED FILES
  src/kmainwindow.cpp

To: broulik, #frameworks, dfaure, aacid
Cc: kde-frameworks-devel, LeGast00n, sbergeron, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20190718/1aa96555/attachment.html>


More information about the Kde-frameworks-devel mailing list