prevent crash when this gets called too early

svn path=/trunk/KDE/kdebase/workspace/plasma/lib/; revision=670543
This commit is contained in:
Aaron J. Seigo 2007-06-01 22:58:48 +00:00
parent 3ccb56568f
commit 357db36e7f

View File

@ -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<Corona*>(scene())->formFactor();
}
Location Applet::location() const
{
if (!scene()) {
return Plasma::Desktop;
}
return static_cast<Corona*>(scene())->location();
}