From fb8898f32814ea6863cdabdb9c26d62fcb93cdf7 Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Fri, 8 Jan 2010 02:03:55 +0000 Subject: [PATCH] if the Applet requests config() before being added to a containment, but is nested in another Applet, it should still use the nest-Applet's config. svn path=/branches/KDE/4.4/kdelibs/; revision=1071438 --- applet.cpp | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/applet.cpp b/applet.cpp index 10af395fc..46bdd4c5c 100644 --- a/applet.cpp +++ b/applet.cpp @@ -2749,17 +2749,16 @@ KConfigGroup *AppletPrivate::mainConfigGroup() } else { KConfigGroup appletConfig; - if (Containment *c = q->containment()) { - Plasma::Applet *parentApplet = qobject_cast(q->parent()); - if (parentApplet && parentApplet != static_cast(c)) { - // this applet is nested inside another applet! use it's config - // as the parent group in the config - appletConfig = parentApplet->config(); - } else { - // applet directly in a Containment, as usual - appletConfig = c->config(); - } - + Containment *c = q->containment(); + Applet *parentApplet = qobject_cast(q->parent()); + if (parentApplet && parentApplet != static_cast(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 + appletConfig = c->config(); appletConfig = KConfigGroup(&appletConfig, "Applets"); } else { kWarning() << "requesting config for" << q->name() << "without a containment!";