Revert "make the type property writable (no wonder it wasn't documented on techbase!)"

This reverts commit a12d487bfc260dea2a9664a05b7c7de5e9d4593a.
This commit is contained in:
Alex Fiestas 2011-12-31 17:06:13 +01:00 committed by Marco Martin
parent ffeb10641b
commit 5f767127c7
2 changed files with 1 additions and 44 deletions

View File

@ -277,48 +277,6 @@ QString Containment::type() const
return d->containment.data()->pluginName();
}
void Containment::setType(const QString &type)
{
if (!d->containment || d->containment.data()->pluginName() == type || type.isEmpty()) {
return;
}
Plasma::Containment *old = d->containment.data();
Plasma::Corona *corona = old->corona();
Plasma::Containment *c = corona->addContainmentDelayed(type);
if (c) {
c->init();
KConfigGroup oldConfig = old->config();
KConfigGroup newConfig = c->config();
// ensure that the old containments configuration is up to date
old->save(oldConfig);
// Copy configuration to new containment
oldConfig.copyTo(&newConfig);
// load the configuration of the old containment into the new one
c->restore(newConfig);
c->updateConstraints(Plasma::StartupCompletedConstraint);
c->flushPendingConstraintsEvents();
foreach (Plasma::Applet *applet, c->applets()) {
applet->init();
// We have to flush the applet constraints manually
applet->flushPendingConstraintsEvents();
}
// destroy the old one
old->destroy(false);
// and now save the config
c->save(newConfig);
corona->requestConfigSync();
d->containment = c;
}
}
void Containment::remove()
{
if (d->containment) {

View File

@ -49,7 +49,7 @@ class PLASMAGENERICSHELL_EXPORT Containment : public Applet
Q_PROPERTY(QString wallpaperPlugin READ wallpaperPlugin WRITE setWallpaperPlugin)
Q_PROPERTY(QString wallpaperMode READ wallpaperMode WRITE setWallpaperMode)
Q_PROPERTY(bool locked READ locked WRITE setLocked)
Q_PROPERTY(QString type READ type WRITE setType)
Q_PROPERTY(QString type READ type)
Q_PROPERTY(QString formFactor READ formFactor)
Q_PROPERTY(QList<int> widgetIds READ widgetIds)
Q_PROPERTY(int screen READ screen WRITE setScreen)
@ -62,7 +62,6 @@ public:
uint id() const;
QString type() const;
void setType(const QString &type);
QString formFactor() const;
QList<int> widgetIds() const;