2007/2/22, Aaron J. Seigo <aseigo@kde.org>:
On February 21, 2007, Rafael Fernández López wrote:
> Well, revisiting this code I see this is just crap. If you close that
> window (still with the unique-applet added to kicker), reopen that window,
> and remove the unique-applet, it won't be added to the list, since
> PluginManager::self() is another different instance. I have seen probably

a) this belongs on panel-devel, not kde-core-devel

 Sorry.

b) any idea why addapplet.cpp was completely reformatted to use tabs instead
of spaces? this file now has no useful svn log and violates the coding style
for that application.

Right. Changing this since I was the one that screwed indentation up here.

c) PluginManager::self() is a singleton so it's always the same object

d) the reason for this bug seems obvious: populateApplets doesn't add an entry
if it's already on the panel and unique; pluginDestroyed() is connected to
updateAppletList(), which just call search(QString) which just filters
applets that are shown (and populateApplets wouldn't have shown it). what
needs to happen is populateApplets should add all items then call search with
an empty string which will hide uniqueApplets. then when pluginDestroyed() is
called it'll show up again.

Mmmm... I should have dedicated 5 minutes more to reread methods deeply. Without any doubt that is the reason. I just don't know why I didn't realize the process is always the same since kicker is always running, and not different instances.

and please: spaces, not tabs. =)

I do since some time ago... :)


Bye,
Rafael Fernández López.