From 584ccf15f4274f55cc730c7146a63cb5264ba4a0 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Tue, 5 Feb 2013 15:53:53 +0100 Subject: [PATCH] don't delay applet init perfectly fixes layout restore. all the applet delayed init mechanism will be removed --- plasma/containment.cpp | 2 +- plasma/corona.cpp | 5 ----- scriptengines/qml/plasmoid/appletinterface.cpp | 3 --- shell/qmlpackages/desktop/contents/ui/main.qml | 3 ++- shell/view.cpp | 2 +- 5 files changed, 4 insertions(+), 11 deletions(-) diff --git a/plasma/containment.cpp b/plasma/containment.cpp index 5c76c4687..360cf723f 100644 --- a/plasma/containment.cpp +++ b/plasma/containment.cpp @@ -362,7 +362,7 @@ void Containment::restoreContents(KConfigGroup &group) continue; } - d->addApplet(plugin, QVariantList(), appletConfig.readEntry("geometry", QRectF()), appId, true); + d->addApplet(plugin, QVariantList(), appletConfig.readEntry("geometry", QRectF()), appId, false); } } diff --git a/plasma/corona.cpp b/plasma/corona.cpp index 11e3d404e..e5bed25b2 100644 --- a/plasma/corona.cpp +++ b/plasma/corona.cpp @@ -695,11 +695,6 @@ QList CoronaPrivate::importLayout(const KConfigGroup &con newContainments.append(c); containmentsIds.insert(c->id()); - c->init(); -#ifndef NDEBUG - kDebug() << "!!{} STARTUP TIME" << QTime().msecsTo(QTime::currentTime()) << "Init Containment" << c->pluginName(); -#endif - c->restore(containmentConfig); #ifndef NDEBUG kDebug() << "!!{} STARTUP TIME" << QTime().msecsTo(QTime::currentTime()) << "Restored Containment" << c->pluginName(); #endif diff --git a/scriptengines/qml/plasmoid/appletinterface.cpp b/scriptengines/qml/plasmoid/appletinterface.cpp index 0d7ab585e..f74d68b70 100644 --- a/scriptengines/qml/plasmoid/appletinterface.cpp +++ b/scriptengines/qml/plasmoid/appletinterface.cpp @@ -473,9 +473,6 @@ void ContainmentInterface::appletAddedForward(Plasma::Applet *applet, const QPoi QObject *contGraphicObject = containment()->property("graphicObject").value(); qDebug() << "Applet added:" << applet << applet->name() << appletGraphicObject; -foreach(Plasma::Applet *appl, containment()->applets()) { - qDebug() << appl << applet->name() << appl->property("graphicObject"); -} if (applet && contGraphicObject && appletGraphicObject) { appletGraphicObject->setProperty("visible", false); diff --git a/shell/qmlpackages/desktop/contents/ui/main.qml b/shell/qmlpackages/desktop/contents/ui/main.qml index 72d65bdbb..420c73af4 100644 --- a/shell/qmlpackages/desktop/contents/ui/main.qml +++ b/shell/qmlpackages/desktop/contents/ui/main.qml @@ -23,6 +23,7 @@ import org.kde.plasma.core 0.1 as PlasmaCore Rectangle { + id: root color: "red" width: 640 height: 480 @@ -30,7 +31,7 @@ Rectangle { property Item containment onContainmentChanged: { - print("New Containment: " + containment + containment.parent) + print("New Containment: " + containment) //containment.parent = root containment.visible = true containment.anchors.fill = root diff --git a/shell/view.cpp b/shell/view.cpp index ca363808d..ce390d965 100644 --- a/shell/view.cpp +++ b/shell/view.cpp @@ -62,7 +62,7 @@ void View::setContainment(Plasma::Containment *cont) if (graphicObject) { qDebug() << "using as graphic containment" << graphicObject << m_containment.data(); - graphicObject->setProperty("visible", false); + //graphicObject->setProperty("visible", false); graphicObject->setProperty("parent", QVariant::fromValue(rootObject())); rootObject()->setProperty("containment", QVariant::fromValue(graphicObject)); } else {