Let Plasma::Corona load the layout on all cases
We either load the existing layout or we load a default one. With this, it could be removed from ShellCorona. REVIEW: 127850
This commit is contained in:
parent
cab7106bb8
commit
9575b8c009
@ -178,6 +178,9 @@ void Corona::loadLayout(const QString &configName)
|
||||
KConfigGroup conf(config(), QString());
|
||||
if (!config()->groupList().isEmpty()) {
|
||||
d->importLayout(conf, false);
|
||||
} else {
|
||||
loadDefaultLayout();
|
||||
d->notifyContainmentsReady();
|
||||
}
|
||||
|
||||
KConfigGroup cg(config(), "General");
|
||||
@ -585,30 +588,38 @@ QList<Plasma::Containment *> CoronaPrivate::importLayout(const KConfigGroup &con
|
||||
}
|
||||
|
||||
if (!mergeConfig) {
|
||||
containmentsStarting = 0;
|
||||
foreach (Containment *containment, containments) {
|
||||
if (!containment->isUiReady() && containment->screen() < q->numScreens() && containment->screen() >= 0) {
|
||||
++containmentsStarting;
|
||||
QObject::connect(containment, &Plasma::Containment::uiReadyChanged, [=](bool ready) {
|
||||
if (!ready) {
|
||||
return;
|
||||
}
|
||||
--containmentsStarting;
|
||||
if (containmentsStarting <= 0) {
|
||||
emit q->startupCompleted();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (containmentsStarting <= 0) {
|
||||
emit q->startupCompleted();
|
||||
}
|
||||
notifyContainmentsReady();
|
||||
}
|
||||
|
||||
return newContainments;
|
||||
}
|
||||
|
||||
void CoronaPrivate::notifyContainmentsReady()
|
||||
{
|
||||
containmentsStarting = 0;
|
||||
foreach (Containment *containment, containments) {
|
||||
if (!containment->isUiReady() && containment->screen() < q->numScreens() && containment->screen() >= 0) {
|
||||
++containmentsStarting;
|
||||
QObject::connect(containment, &Plasma::Containment::uiReadyChanged, q, [this](bool ready) { containmentReady(ready); } );
|
||||
}
|
||||
}
|
||||
|
||||
if (containmentsStarting <= 0) {
|
||||
emit q->startupCompleted();
|
||||
}
|
||||
}
|
||||
|
||||
void CoronaPrivate::containmentReady(bool ready)
|
||||
{
|
||||
if (!ready) {
|
||||
return;
|
||||
}
|
||||
--containmentsStarting;
|
||||
if (containmentsStarting <= 0) {
|
||||
emit q->startupCompleted();
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace Plasma
|
||||
|
||||
#include "moc_corona.cpp"
|
||||
|
@ -365,6 +365,7 @@ private:
|
||||
Q_PRIVATE_SLOT(d, void containmentDestroyed(QObject *))
|
||||
Q_PRIVATE_SLOT(d, void syncConfig())
|
||||
Q_PRIVATE_SLOT(d, void toggleImmutability())
|
||||
Q_PRIVATE_SLOT(d, void containmentReady(bool))
|
||||
|
||||
friend class CoronaPrivate;
|
||||
friend class View;
|
||||
|
@ -45,6 +45,8 @@ public:
|
||||
void updateContainmentImmutability();
|
||||
void containmentDestroyed(QObject *obj);
|
||||
void syncConfig();
|
||||
void notifyContainmentsReady();
|
||||
void containmentReady(bool ready);
|
||||
Containment *addContainment(const QString &name, const QVariantList &args, uint id, bool delayedInit = false);
|
||||
QList<Plasma::Containment *> importLayout(const KConfigGroup &conf, bool mergeConfig);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user