* be sure to set kiosk-based immutability

* don't allow external creation of containments if the corona is immutable; they won't get saved to disk anyways

svn path=/trunk/KDE/kdelibs/; revision=1196287
This commit is contained in:
Aaron J. Seigo 2010-11-12 22:51:31 +00:00
parent 8607a13142
commit 0e5e5b7c9d

View File

@ -402,12 +402,12 @@ void Corona::initializeLayout(const QString &configName)
} }
if (config()->isImmutable()) { if (config()->isImmutable()) {
d->updateContainmentImmutability(); setImmutability(SystemImmutable);
} } else {
KConfigGroup coronaConfig(config(), "General"); KConfigGroup coronaConfig(config(), "General");
setImmutability((ImmutabilityType)coronaConfig.readEntry("immutability", (int)Mutable)); setImmutability((ImmutabilityType)coronaConfig.readEntry("immutability", (int)Mutable));
} }
}
bool containmentSortByPosition(const Containment *c1, const Containment *c2) bool containmentSortByPosition(const Containment *c1, const Containment *c2)
{ {
@ -606,14 +606,22 @@ KSharedConfigPtr Corona::config() const
Containment *Corona::addContainment(const QString &name, const QVariantList &args) Containment *Corona::addContainment(const QString &name, const QVariantList &args)
{ {
if (d->immutability == Mutable) {
return d->addContainment(name, args, 0, false); return d->addContainment(name, args, 0, false);
} }
return 0;
}
Containment *Corona::addContainmentDelayed(const QString &name, const QVariantList &args) Containment *Corona::addContainmentDelayed(const QString &name, const QVariantList &args)
{ {
if (d->immutability == Mutable) {
return d->addContainment(name, args, 0, true); return d->addContainment(name, args, 0, true);
} }
return 0;
}
void Corona::mapAnimation(Animator::Animation from, Animator::Animation to) void Corona::mapAnimation(Animator::Animation from, Animator::Animation to)
{ {
AnimatorPrivate::mapAnimation(from, to); AnimatorPrivate::mapAnimation(from, to);
@ -880,8 +888,7 @@ ImmutabilityType Corona::immutability() const
void Corona::setImmutability(const ImmutabilityType immutable) void Corona::setImmutability(const ImmutabilityType immutable)
{ {
if (d->immutability == immutable || if (d->immutability == immutable || d->immutability == SystemImmutable) {
d->immutability == SystemImmutable) {
return; return;
} }
@ -906,6 +913,7 @@ void Corona::setImmutability(const ImmutabilityType immutable)
} }
} }
if (d->immutability != SystemImmutable) {
KConfigGroup cg(config(), "General"); KConfigGroup cg(config(), "General");
// we call the dptr member directly for locked since isImmutable() // we call the dptr member directly for locked since isImmutable()
@ -913,6 +921,7 @@ void Corona::setImmutability(const ImmutabilityType immutable)
cg.writeEntry("immutability", (int)d->immutability); cg.writeEntry("immutability", (int)d->immutability);
requestConfigSync(); requestConfigSync();
} }
}
QList<Plasma::Location> Corona::freeEdges(int screen) const QList<Plasma::Location> Corona::freeEdges(int screen) const
{ {