* 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:
parent
8607a13142
commit
0e5e5b7c9d
19
corona.cpp
19
corona.cpp
@ -402,12 +402,12 @@ void Corona::initializeLayout(const QString &configName)
|
||||
}
|
||||
|
||||
if (config()->isImmutable()) {
|
||||
d->updateContainmentImmutability();
|
||||
}
|
||||
|
||||
setImmutability(SystemImmutable);
|
||||
} else {
|
||||
KConfigGroup coronaConfig(config(), "General");
|
||||
setImmutability((ImmutabilityType)coronaConfig.readEntry("immutability", (int)Mutable));
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
if (d->immutability == Mutable) {
|
||||
return d->addContainment(name, args, 0, false);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Containment *Corona::addContainmentDelayed(const QString &name, const QVariantList &args)
|
||||
{
|
||||
if (d->immutability == Mutable) {
|
||||
return d->addContainment(name, args, 0, true);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Corona::mapAnimation(Animator::Animation from, Animator::Animation to)
|
||||
{
|
||||
AnimatorPrivate::mapAnimation(from, to);
|
||||
@ -880,8 +888,7 @@ ImmutabilityType Corona::immutability() const
|
||||
|
||||
void Corona::setImmutability(const ImmutabilityType immutable)
|
||||
{
|
||||
if (d->immutability == immutable ||
|
||||
d->immutability == SystemImmutable) {
|
||||
if (d->immutability == immutable || d->immutability == SystemImmutable) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -906,6 +913,7 @@ void Corona::setImmutability(const ImmutabilityType immutable)
|
||||
}
|
||||
}
|
||||
|
||||
if (d->immutability != SystemImmutable) {
|
||||
KConfigGroup cg(config(), "General");
|
||||
|
||||
// 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);
|
||||
requestConfigSync();
|
||||
}
|
||||
}
|
||||
|
||||
QList<Plasma::Location> Corona::freeEdges(int screen) const
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user