Introduce singleton for KFilePlacesModel
ClosedPublic

Authored by broulik on Mar 13 2018, 11:54 AM.

Details

Summary

There are various places where Dolphin created a new KFilePlacesModel which would then query all storage devices and do other expensive work.

Test Plan

It showed up as 37% cost on startup before, now it's 21%

  • Verified that only one instance is created and devices are only queried once.
  • Verified that places selector in URL bar still works
  • Verified that devices are still shown in sidebar
  • Adding places still works and is persisted between starts
  • Title bar still shows nice place names, e.g. "Home" instead of "username"

Diff Detail

Repository
R318 Dolphin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
broulik requested review of this revision.Mar 13 2018, 11:54 AM
broulik created this revision.
broulik updated this revision to Diff 29392.Mar 13 2018, 11:58 AM
  • Rebase on master
src/dolphinplacesmodelsingleton.cpp
27

Where does m_placesModel get deleted?

broulik updated this revision to Diff 29573.Mar 15 2018, 8:59 AM
  • Use QScopedPointer
elvisangelaccio requested changes to this revision.Mar 15 2018, 9:53 PM
elvisangelaccio added inline comments.
src/panels/places/placesitemmodel.cpp
45–46

This comment should also be moved.

This revision now requires changes to proceed.Mar 15 2018, 9:53 PM
broulik updated this revision to Diff 29664.Mar 16 2018, 8:07 AM
  • Move comment
elvisangelaccio added inline comments.
src/dolphinplacesmodelsingleton.h
39–40

Doxygen tags?

This revision was not accepted when it landed; it landed in state Needs Review.Mar 19 2018, 8:58 AM
This revision was automatically updated to reflect the committed changes.