support a corona child of an applet
this is an ad-hoc thing for the systray, would be better not having something like that
This commit is contained in:
parent
b68bbca6c8
commit
362a5017b6
@ -358,12 +358,21 @@ KConfigGroup *AppletPrivate::mainConfigGroup()
|
|||||||
return mainConfig;
|
return mainConfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Containment *c = q->containment();
|
||||||
|
Plasma::Applet *parentApplet = 0;
|
||||||
|
if (c && c->corona()) {
|
||||||
|
parentApplet = qobject_cast<Plasma::Applet *>(c->corona()->parent());
|
||||||
|
}
|
||||||
|
|
||||||
if (q->isContainment()) {
|
if (q->isContainment()) {
|
||||||
Corona *corona = static_cast<Containment*>(q)->corona();
|
Corona *corona = static_cast<Containment*>(q)->corona();
|
||||||
KConfigGroup containmentConfig;
|
KConfigGroup containmentConfig;
|
||||||
//qDebug() << "got a corona, baby?" << (QObject*)corona << (QObject*)q;
|
//qDebug() << "got a corona, baby?" << (QObject*)corona << (QObject*)q;
|
||||||
|
|
||||||
if (corona) {
|
if (parentApplet) {
|
||||||
|
containmentConfig = parentApplet->config();
|
||||||
|
containmentConfig = KConfigGroup(&containmentConfig, "Containments");
|
||||||
|
} else if (corona) {
|
||||||
containmentConfig = KConfigGroup(corona->config(), "Containments");
|
containmentConfig = KConfigGroup(corona->config(), "Containments");
|
||||||
} else {
|
} else {
|
||||||
containmentConfig = KConfigGroup(KSharedConfig::openConfig(), "Containments");
|
containmentConfig = KConfigGroup(KSharedConfig::openConfig(), "Containments");
|
||||||
@ -373,14 +382,7 @@ KConfigGroup *AppletPrivate::mainConfigGroup()
|
|||||||
} else {
|
} else {
|
||||||
KConfigGroup appletConfig;
|
KConfigGroup appletConfig;
|
||||||
|
|
||||||
Containment *c = q->containment();
|
if (c) {
|
||||||
Applet *parentApplet = qobject_cast<Applet *>(q->parent());
|
|
||||||
if (parentApplet && parentApplet != static_cast<Applet *>(c)) {
|
|
||||||
// this applet is nested inside another applet! use it's config
|
|
||||||
// as the parent group in the config
|
|
||||||
appletConfig = parentApplet->config();
|
|
||||||
appletConfig = KConfigGroup(&appletConfig, "Applets");
|
|
||||||
} else if (c) {
|
|
||||||
// applet directly in a Containment, as usual
|
// applet directly in a Containment, as usual
|
||||||
appletConfig = c->config();
|
appletConfig = c->config();
|
||||||
appletConfig = KConfigGroup(&appletConfig, "Applets");
|
appletConfig = KConfigGroup(&appletConfig, "Applets");
|
||||||
|
@ -84,6 +84,7 @@ AppletInterface::AppletInterface(DeclarativeAppletScript *script, QQuickItem *pa
|
|||||||
this, &ContainmentInterface::screenChanged);
|
this, &ContainmentInterface::screenChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setProperty("_plasma_applet", QVariant::fromValue(applet()));
|
||||||
}
|
}
|
||||||
|
|
||||||
AppletInterface::~AppletInterface()
|
AppletInterface::~AppletInterface()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user