Skip to content

notificationmanager: Don't store KFilePlacesModel in a weak pointer

Arjen Hiemstra requested to merge work/ahiemstra/notification_places into master

KFilePlacesModel is used to look up "pretty names" for jobs. It is quite expensive to construct. The current code tries to ensure there is a single instance around when there are jobs active, however because it uses a weak pointer for storage, when there is no job around, the model gets destroyed and we recreate it when there's a job again. To avoid this, just store it in a "strong" pointer so we create it once and it stays around.

While we're at it, switch to using std::shared_ptr like we've done in other places.

Merge request reports