better bookeeping of the config
ClosedPublic

Authored by mart on Sep 20 2016, 10:42 AM.

Details

Reviewers
davidedmundson
Group Reviewers
Plasma
Summary

be able to destroy applets even when locked: delete their config
by hand.
Except in one case: when the applet gets automatically destroyed
by dbus activation do *not* clear the config, it should be
reused next time.

When there is already a config for a given plasmoid, reuse it
instead of creating a brand new plasmoid (having config groups
endlessy accumulating in the config file)

BUG:365618
BUG:365569

Test Plan
  • added and removed plasmoids in locked mode
  • they get correctly added and removed
  • config groups get correctly deleted, also in locked mode
  • config groups gets correctly reused on subsequent sessions
  • no piling up on config groups in appletsrc

Diff Detail

Repository
R120 Plasma Workspace
Branch
arcpatch-D2817
Lint
No Linters Available
Unit
No Unit Test Coverage
mart updated this revision to Diff 6825.Sep 20 2016, 10:42 AM
mart retitled this revision from to better bookeeping of the config.
mart updated this object.
Restricted Application added a project: Plasma. · View Herald TranscriptSep 20 2016, 10:42 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
mart edited the test plan for this revision. (Show Details)Sep 20 2016, 10:44 AM
mart added a reviewer: Plasma.
sebas added a subscriber: sebas.Sep 20 2016, 10:55 AM
sebas added inline comments.
applets/systemtray/systemtray.cpp
139

I think applet can be null here

davidedmundson added inline comments.
applets/systemtray/systemtray.cpp
136–153

Is this for the DBus activated case?

163

This reintroduces the NetworkManager restarting bug.

Applet exists, is still in applets() but now isn't marked as transient as you're not marking it as such.

394–397

C++ applets can override cleanupAndDelete

You're skipping that.
(not that any do)

applets/systemtray/systemtray.cpp
394–397

Edit. I was wrong, it is virtual, but private within p-f. Ignore this.

mart added inline comments.Sep 20 2016, 11:10 AM
applets/systemtray/systemtray.cpp
136–153

not only, actually this case is true for each startup after the first, during normal config restore. This is the branch always executed except when a previously unknown applet is added

163

don't know how to properly fix it without changes in p-f tough ( i could still call destroy() in case of mutable, tough when an applet goes away for dbus reasons, its config should actually not be removed (so shouldn't be transient)..

mart added inline comments.Sep 20 2016, 11:15 AM
applets/systemtray/systemtray.cpp
163

instead of applet->destroyed() i could connect to its destroyed signal and keep a list of deleteLater()ed applets...

mart added a comment.Sep 20 2016, 11:22 AM

or could (ouch)manually emit applet::appletDeleted() from the outside that's yeah, horrible but would immediately remove the applet from applets()..

In D2817#52467, @mart wrote:

or could (ouch)manually emit applet::appletDeleted() from the outside that's yeah, horrible but would immediately remove the applet from applets()..

Looks like it would work.

mart updated this revision to Diff 6826.Sep 20 2016, 11:59 AM
  • address issues
mart added inline comments.Sep 20 2016, 12:14 PM
applets/systemtray/systemtray.cpp
163

restarting Networkmanager seems to cause the applet to reload correctly

mart added inline comments.Sep 20 2016, 12:19 PM
applets/systemtray/systemtray.cpp
163

hm, in that case still seems to create a spurious duplicate config group tough

mart updated this revision to Diff 6827.Sep 20 2016, 12:27 PM
  • update knownplugins when creating a new applet
mart added a comment.Sep 20 2016, 12:28 PM

in the latest version restarting networkmanager fully works as expected: it gets restarted and its old config group gets used

davidedmundson accepted this revision.Sep 20 2016, 12:52 PM
davidedmundson added a reviewer: davidedmundson.

Ideally maybe split the m_knownTasks loading and the deletion changes into two commits, they're not entirely related

This revision is now accepted and ready to land.Sep 20 2016, 12:52 PM
mart closed this revision.Sep 20 2016, 1:05 PM

merged in 2 separate commits