diff --git a/applet.cpp b/applet.cpp index 5693a1f87..2671916cc 100644 --- a/applet.cpp +++ b/applet.cpp @@ -137,16 +137,24 @@ bool Applet::loadDataEngine( const QString& name ) void Applet::constraintsUpdated() { - kDebug() << "constraints are FormFactor: " << formFactor() << ", Location: " << location() << endl; + kDebug() << "Applet::constraintsUpdate(): constraints are FormFactor: " << formFactor() << ", Location: " << location() << endl; } FormFactor Applet::formFactor() const { + if (!scene()) { + return Plasma::Planar; + } + return static_cast(scene())->formFactor(); } Location Applet::location() const { + if (!scene()) { + return Plasma::Desktop; + } + return static_cast(scene())->location(); }