IMPROVEMENT: when searcing for our hostApplet, always look for the extenders's applet before,

it is slightly faster and -partly- fixes the inability of detecting the host applet when it is an applet-in-applet, like the systray

svn path=/trunk/KDE/kdelibs/; revision=1177632
This commit is contained in:
Marco Martin 2010-09-20 19:25:30 +00:00
parent 7d00f6c756
commit 6655948ccd
2 changed files with 17 additions and 9 deletions

View File

@ -699,6 +699,9 @@ void ExtenderPrivate::loadExtenderItems()
if (containment) {
Corona *corona = containment->corona();
if (sourceAppletId == q->applet()->id()) {
sourceApplet = q->applet();
} else {
foreach (Containment *containment, corona->containments()) {
foreach (Applet *applet, containment->applets()) {
if (applet->id() == sourceAppletId) {
@ -708,6 +711,7 @@ void ExtenderPrivate::loadExtenderItems()
}
}
}
}
//There is no source applet. We just instantiate one just for the sake of creating
//detachables.

View File

@ -175,6 +175,9 @@ ExtenderItem::ExtenderItem(Extender *hostExtender, uint extenderItemId)
//Find the sourceapplet.
Corona *corona = hostExtender->d->applet.data()->containment()->corona();
if (sourceAppletId == hostExtender->applet()->id()) {
d->sourceApplet = hostExtender->applet();
} else {
foreach (Containment *containment, corona->containments()) {
foreach (Applet *applet, containment->applets()) {
if (applet->id() == sourceAppletId &&
@ -184,6 +187,7 @@ ExtenderItem::ExtenderItem(Extender *hostExtender, uint extenderItemId)
}
}
}
}
//make sure we keep monitoring if the source applet still exists, so the return to source icon
//can be hidden if it is removed.