differentiate between runtime and kiosk immutability
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=744675
This commit is contained in:
parent
f7a0308982
commit
e2249860fd
18
applet.cpp
18
applet.cpp
@ -599,7 +599,14 @@ QString Applet::category(const QString& appletName)
|
||||
|
||||
bool Applet::isImmutable() const
|
||||
{
|
||||
return (containment() && containment()->isImmutable()) || d->immutable || d->kioskImmutable;
|
||||
return d->immutable || d->kioskImmutable ||
|
||||
(containment() && containment()->isImmutable()) ||
|
||||
(scene() && static_cast<Corona*>(scene())->isImmutable());
|
||||
}
|
||||
|
||||
bool Applet::isKioskImmutable() const
|
||||
{
|
||||
return d->kioskImmutable;
|
||||
}
|
||||
|
||||
void Applet::setImmutable(bool immutable)
|
||||
@ -716,7 +723,9 @@ void Applet::performSetupConfig()
|
||||
|
||||
void Applet::checkImmutability()
|
||||
{
|
||||
d->kioskImmutable = globalConfig().isImmutable() || config().isImmutable();
|
||||
d->kioskImmutable = globalConfig().isImmutable() || config().isImmutable() ||
|
||||
(containment() && containment()->isKioskImmutable()) ||
|
||||
(scene() && static_cast<Corona*>(scene())->isKioskImmutable());
|
||||
setImmutable(d->kioskImmutable);
|
||||
}
|
||||
|
||||
@ -883,13 +892,14 @@ FormFactor Applet::formFactor() const
|
||||
Containment* Applet::containment() const
|
||||
{
|
||||
QGraphicsItem *parent = parentItem();
|
||||
Containment *c = 0;
|
||||
while (parent) {
|
||||
if (dynamic_cast<Containment*>(parent)) {
|
||||
if ((c = dynamic_cast<Containment*>(parent))) {
|
||||
break;
|
||||
}
|
||||
parent = parent->parentItem();
|
||||
}
|
||||
return dynamic_cast<Containment*>(parent);
|
||||
return c;
|
||||
}
|
||||
|
||||
Location Applet::location() const
|
||||
|
5
applet.h
5
applet.h
@ -401,6 +401,11 @@ class PLASMA_EXPORT Applet : public Widget
|
||||
**/
|
||||
bool isImmutable() const;
|
||||
|
||||
/**
|
||||
* @return true if this applet is immutable due to Kiosk settings
|
||||
*/
|
||||
bool isKioskImmutable() const;
|
||||
|
||||
/**
|
||||
* @return returns whether or not the applet is using the standard
|
||||
* background
|
||||
|
10
corona.cpp
10
corona.cpp
@ -67,6 +67,7 @@ public:
|
||||
}
|
||||
|
||||
bool immutable;
|
||||
bool kioskImmutable;
|
||||
QString mimetype;
|
||||
QString configName;
|
||||
KSharedConfigPtr config;
|
||||
@ -225,7 +226,7 @@ void Corona::loadApplets(const QString& configName)
|
||||
}
|
||||
}
|
||||
|
||||
setImmutable(config.isImmutable());
|
||||
d->kioskImmutable = config.isImmutable();
|
||||
}
|
||||
|
||||
void Corona::loadApplets()
|
||||
@ -457,7 +458,12 @@ void Corona::screenResized(int screen)
|
||||
|
||||
bool Corona::isImmutable() const
|
||||
{
|
||||
return d->immutable;
|
||||
return d->kioskImmutable || d->immutable;
|
||||
}
|
||||
|
||||
bool Corona::isKioskImmutable() const
|
||||
{
|
||||
return d->kioskImmutable;
|
||||
}
|
||||
|
||||
void Corona::setImmutable(bool immutable)
|
||||
|
Loading…
Reference in New Issue
Block a user