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,10 +699,14 @@ void ExtenderPrivate::loadExtenderItems()
if (containment) {
Corona *corona = containment->corona();
foreach (Containment *containment, corona->containments()) {
foreach (Applet *applet, containment->applets()) {
if (applet->id() == sourceAppletId) {
sourceApplet = applet;
if (sourceAppletId == q->applet()->id()) {
sourceApplet = q->applet();
} else {
foreach (Containment *containment, corona->containments()) {
foreach (Applet *applet, containment->applets()) {
if (applet->id() == sourceAppletId) {
sourceApplet = applet;
}
}
}
}

View File

@ -175,11 +175,15 @@ ExtenderItem::ExtenderItem(Extender *hostExtender, uint extenderItemId)
//Find the sourceapplet.
Corona *corona = hostExtender->d->applet.data()->containment()->corona();
foreach (Containment *containment, corona->containments()) {
foreach (Applet *applet, containment->applets()) {
if (applet->id() == sourceAppletId &&
applet->pluginName() == dg.readEntry("sourceAppletPluginName", "")) {
d->sourceApplet = applet;
if (sourceAppletId == hostExtender->applet()->id()) {
d->sourceApplet = hostExtender->applet();
} else {
foreach (Containment *containment, corona->containments()) {
foreach (Applet *applet, containment->applets()) {
if (applet->id() == sourceAppletId &&
applet->pluginName() == dg.readEntry("sourceAppletPluginName", "")) {
d->sourceApplet = applet;
}
}
}
}