D14426: [Folder View] Create KFilePlacesModel only when needed and listen for changes

Kai Uwe Broulik noreply at phabricator.kde.org
Fri Jul 27 13:32:47 BST 2018


broulik created this revision.
broulik added reviewers: Plasma, hein.
Restricted Application added a project: Plasma.
Restricted Application added a subscriber: plasma-devel.
broulik requested review of this revision.

REVISION SUMMARY
  When no label is displayed, there's no point in creating a `KFilePlacesModel`
  Also, only emit a change for `displayLabel` when it actually changed.
  Moreover, listen to changes in the `KFilePlacesModel` and update the label if needed

TEST PLAN
  - My test partition still has its proper "Device" name (devices are populated deferred, so if we didn't listen for changes, creating a model and asking for `closestItem` right away would return Root (`/media/foo` is closed to `/`)
  - Reduces the number of `displayLabelChanged` emissions to half on startup
  - Added a Pictures folder view, renamed my Pictures place in Dolphin, label updated immediately
  - Verified in GammaRay there's no `KFilePlacesModel` instance in plasmashell unless having a Folder View widget on desktop or panel (but not in the default containment case)

REPOSITORY
  R119 Plasma Desktop

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

AFFECTED FILES
  containments/desktop/plugins/folder/labelgenerator.cpp
  containments/desktop/plugins/folder/labelgenerator.h

To: broulik, #plasma, hein
Cc: plasma-devel, ragreen, Pitel, ZrenBot, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20180727/15ed6f05/attachment.html>


More information about the Plasma-devel mailing list