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
35
corona.cpp
35
corona.cpp
@ -240,9 +240,28 @@ void Corona::Private::scheduleConfigSync()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Corona::loadLayout(const QString& configName)
|
void Corona::initializeLayout(const QString &configName)
|
||||||
{
|
{
|
||||||
clearContainments();
|
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;
|
KSharedConfigPtr c;
|
||||||
|
|
||||||
if (configName.isEmpty() || configName == d->configName) {
|
if (configName.isEmpty() || configName == d->configName) {
|
||||||
@ -273,12 +292,6 @@ void Corona::loadLayout(const QString& configName)
|
|||||||
c->restore(containmentConfig);
|
c->restore(containmentConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (d->containments.isEmpty()) {
|
|
||||||
loadDefaultLayout();
|
|
||||||
if (!d->containments.isEmpty()) {
|
|
||||||
d->scheduleConfigSync();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
foreach (Containment* containment, d->containments) {
|
foreach (Containment* containment, d->containments) {
|
||||||
QString cid = QString::number(containment->id());
|
QString cid = QString::number(containment->id());
|
||||||
KConfigGroup containmentConfig(&containments, cid);
|
KConfigGroup containmentConfig(&containments, cid);
|
||||||
@ -291,14 +304,6 @@ void Corona::loadLayout(const QString& configName)
|
|||||||
containment->flushPendingConstraintsEvents();
|
containment->flushPendingConstraintsEvents();
|
||||||
emit containmentAdded(containment);
|
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
|
Containment* Corona::containmentForScreen(int screen) const
|
||||||
|
13
corona.h
13
corona.h
@ -94,7 +94,18 @@ public:
|
|||||||
|
|
||||||
public Q_SLOTS:
|
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,
|
* @param config the name of the config file to load from,
|
||||||
* or the default config file if QString()
|
* or the default config file if QString()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user