save/restore lock status

CCMAIL:tokoe@kde.org

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=745809
This commit is contained in:
Aaron J. Seigo 2007-12-07 05:02:54 +00:00
parent 1adb4d7387
commit 059505f639
3 changed files with 14 additions and 3 deletions

View File

@ -433,6 +433,9 @@ uint Applet::id() const
void Applet::save(KConfigGroup* group) const
{
// we call the dptr member directly for locked since isImmutable()
// also checks kiosk and parent containers
group->writeEntry("locked", d->immutable);
group->writeEntry("plugin", pluginName());
//FIXME: for containments, we need to have some special values here w/regards to
// screen affinity (e.g. "bottom of screen 0")

View File

@ -138,6 +138,7 @@ void Containment::loadConstraints(KConfigGroup* group)
void Containment::saveConstraints(KConfigGroup* group) const
{
// locking is saved in Applet::save
group->writeEntry("screen", d->screen);
group->writeEntry("formfactor", (int)d->formFactor);
group->writeEntry("location", (int)d->location);

View File

@ -100,6 +100,11 @@ Corona::Corona(qreal x, qreal y, qreal width, qreal height, QObject * parent)
Corona::~Corona()
{
KConfigGroup cg(config(), "General");
// we call the dptr member directly for locked since isImmutable()
// also checks kiosk and parent containers
cg.writeEntry("locked", d->immutable);
delete d;
}
@ -149,8 +154,7 @@ void Corona::loadApplets(const QString& configName)
clearApplets();
d->configName = configName;
KConfig config(configName, KConfig::SimpleConfig);
KConfigGroup containments(&config, "Containments");
KConfigGroup containments(config(), "Containments");
foreach (const QString& group, containments.groupList()) {
KConfigGroup containmentConfig(&containments, group);
@ -225,7 +229,9 @@ void Corona::loadApplets(const QString& configName)
}
}
d->kioskImmutable = config.isImmutable();
d->kioskImmutable = config()->isImmutable();
KConfigGroup coronaConfig(config(), "General");
setImmutable(coronaConfig.readEntry("locked", false));
}
void Corona::loadApplets()
@ -467,6 +473,7 @@ bool Corona::isKioskImmutable() const
void Corona::setImmutable(bool immutable)
{
kDebug() << "setting immutability to" << immutable;
if (d->immutable == immutable) {
return;
}