delete containments upon activity deletion
ClosedPublic

Authored by mart on Oct 6 2016, 2:21 PM.

Details

Summary

after the latest activities refactor, containments weren't
deleted anymore upon activity deletion.

Test Plan

created and deleted activities while monitoring how appletsrc file
was updated

Diff Detail

Repository
R120 Plasma Workspace
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
mart updated this revision to Diff 7159.Oct 6 2016, 2:21 PM
mart retitled this revision from to delete containments upon activity deletion.
mart updated this object.
mart edited the test plan for this revision. (Show Details)
mart added a reviewer: Plasma.
Restricted Application added a project: Plasma. · View Herald TranscriptOct 6 2016, 2:21 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
mart added a reviewer: ivan.Oct 6 2016, 2:21 PM
davidedmundson requested changes to this revision.Oct 6 2016, 10:23 PM
davidedmundson added a reviewer: davidedmundson.
davidedmundson added a subscriber: davidedmundson.

m_desktopContainments.remove(id);

should not be here.

This revision now requires changes to proceed.Oct 6 2016, 10:23 PM
mart added a comment.Oct 7 2016, 10:44 AM

m_desktopContainments.remove(id);

should not be here.

why not? m_desktopContainments is a QHash<QString, QSet<Plasma::Containment *> > indexed by activity, if i don't update it manually here, it will stay full of dangling stuff..

But it also tracks them and deletes when an object is removed:
ShellCorona::desktopContainmentDestroyed

If you manually do it as well you're throwing all sense of a design pattern out the window and having it sometimes update the list before removal, sometimes after. Inconsistencies lead to bugs.

mart updated this revision to Diff 7189.Oct 7 2016, 11:01 AM
mart edited edge metadata.
  • remove duplicate remove
mart added a comment.Oct 7 2016, 11:01 AM

But it also tracks them and deletes when an object is removed:
ShellCorona::desktopContainmentDestroyed

If you manually do it as well you're throwing all sense of a design pattern out the window and having it sometimes update the list before removal, sometimes after. Inconsistencies lead to bugs.

ugh, i didn't remember that (that's what reviews are for, eh ;) fixed now

davidedmundson accepted this revision.Oct 7 2016, 11:15 AM
davidedmundson edited edge metadata.
This revision is now accepted and ready to land.Oct 7 2016, 11:15 AM
This revision was automatically updated to reflect the committed changes.