add initializeLayout and separate the start up stuff from loadLayout into it so that we can properly load add on layouts
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=811892
This commit is contained in:
parent
e9989989c5
commit
590b3cebd8
53
corona.cpp
53
corona.cpp
@ -240,9 +240,28 @@ void Corona::Private::scheduleConfigSync()
|
||||
}
|
||||
}
|
||||
|
||||
void Corona::loadLayout(const QString& configName)
|
||||
void Corona::initializeLayout(const QString &configName)
|
||||
{
|
||||
clearContainments();
|
||||
loadLayout(configName);
|
||||
|
||||
if (d->containments.isEmpty()) {
|
||||
loadDefaultLayout();
|
||||
if (!d->containments.isEmpty()) {
|
||||
d->scheduleConfigSync();
|
||||
}
|
||||
}
|
||||
|
||||
if (config()->isImmutable()) {
|
||||
d->updateContainmentImmutability();
|
||||
}
|
||||
|
||||
KConfigGroup coronaConfig(config(), "General");
|
||||
setImmutability((ImmutabilityType)coronaConfig.readEntry("immutability", (int)Mutable));
|
||||
}
|
||||
|
||||
void Corona::loadLayout(const QString& configName)
|
||||
{
|
||||
KSharedConfigPtr c;
|
||||
|
||||
if (configName.isEmpty() || configName == d->configName) {
|
||||
@ -273,32 +292,18 @@ void Corona::loadLayout(const QString& configName)
|
||||
c->restore(containmentConfig);
|
||||
}
|
||||
|
||||
if (d->containments.isEmpty()) {
|
||||
loadDefaultLayout();
|
||||
if (!d->containments.isEmpty()) {
|
||||
d->scheduleConfigSync();
|
||||
foreach (Containment* containment, d->containments) {
|
||||
QString cid = QString::number(containment->id());
|
||||
KConfigGroup containmentConfig(&containments, cid);
|
||||
|
||||
foreach(Applet* applet, containment->applets()) {
|
||||
applet->init();
|
||||
}
|
||||
} else {
|
||||
foreach (Containment* containment, d->containments) {
|
||||
QString cid = QString::number(containment->id());
|
||||
KConfigGroup containmentConfig(&containments, cid);
|
||||
|
||||
foreach(Applet* applet, containment->applets()) {
|
||||
applet->init();
|
||||
}
|
||||
|
||||
containment->updateConstraints(Plasma::StartupCompletedConstraint);
|
||||
containment->flushPendingConstraintsEvents();
|
||||
emit containmentAdded(containment);
|
||||
}
|
||||
containment->updateConstraints(Plasma::StartupCompletedConstraint);
|
||||
containment->flushPendingConstraintsEvents();
|
||||
emit containmentAdded(containment);
|
||||
}
|
||||
|
||||
if (config()->isImmutable()) {
|
||||
d->updateContainmentImmutability();
|
||||
}
|
||||
|
||||
KConfigGroup coronaConfig(config(), "General");
|
||||
setImmutability((ImmutabilityType)coronaConfig.readEntry("immutability", (int)Mutable));
|
||||
}
|
||||
|
||||
Containment* Corona::containmentForScreen(int screen) const
|
||||
|
13
corona.h
13
corona.h
@ -94,7 +94,18 @@ public:
|
||||
|
||||
public Q_SLOTS:
|
||||
/**
|
||||
* Load applet layout from a config file
|
||||
* Initializes the layout from a config file. This will first clear any existing
|
||||
* Containments, load a layout from the requested configuration file, request the
|
||||
* default layout if needed and update immutability.
|
||||
*
|
||||
* @param config the name of the config file to load from,
|
||||
* or the default config file if QString()
|
||||
*/
|
||||
void initializeLayout(const QString &config = QString());
|
||||
|
||||
/**
|
||||
* Load applet layout from a config file. The results will be added to the
|
||||
* current set of Containments.
|
||||
*
|
||||
* @param config the name of the config file to load from,
|
||||
* or the default config file if QString()
|
||||
|
Loading…
Reference in New Issue
Block a user