don't delay applet init

perfectly fixes layout restore.
all the applet delayed init mechanism will be removed
This commit is contained in:
Marco Martin 2013-02-05 15:53:53 +01:00
parent 48561504c8
commit 584ccf15f4
5 changed files with 4 additions and 11 deletions

View File

@ -362,7 +362,7 @@ void Containment::restoreContents(KConfigGroup &group)
continue; continue;
} }
d->addApplet(plugin, QVariantList(), appletConfig.readEntry("geometry", QRectF()), appId, true); d->addApplet(plugin, QVariantList(), appletConfig.readEntry("geometry", QRectF()), appId, false);
} }
} }

View File

@ -695,11 +695,6 @@ QList<Plasma::Containment *> CoronaPrivate::importLayout(const KConfigGroup &con
newContainments.append(c); newContainments.append(c);
containmentsIds.insert(c->id()); 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 #ifndef NDEBUG
kDebug() << "!!{} STARTUP TIME" << QTime().msecsTo(QTime::currentTime()) << "Restored Containment" << c->pluginName(); kDebug() << "!!{} STARTUP TIME" << QTime().msecsTo(QTime::currentTime()) << "Restored Containment" << c->pluginName();
#endif #endif

View File

@ -473,9 +473,6 @@ void ContainmentInterface::appletAddedForward(Plasma::Applet *applet, const QPoi
QObject *contGraphicObject = containment()->property("graphicObject").value<QObject *>(); QObject *contGraphicObject = containment()->property("graphicObject").value<QObject *>();
qDebug() << "Applet added:" << applet << applet->name() << appletGraphicObject; qDebug() << "Applet added:" << applet << applet->name() << appletGraphicObject;
foreach(Plasma::Applet *appl, containment()->applets()) {
qDebug() << appl << applet->name() << appl->property("graphicObject");
}
if (applet && contGraphicObject && appletGraphicObject) { if (applet && contGraphicObject && appletGraphicObject) {
appletGraphicObject->setProperty("visible", false); appletGraphicObject->setProperty("visible", false);

View File

@ -23,6 +23,7 @@ import org.kde.plasma.core 0.1 as PlasmaCore
Rectangle { Rectangle {
id: root
color: "red" color: "red"
width: 640 width: 640
height: 480 height: 480
@ -30,7 +31,7 @@ Rectangle {
property Item containment property Item containment
onContainmentChanged: { onContainmentChanged: {
print("New Containment: " + containment + containment.parent) print("New Containment: " + containment)
//containment.parent = root //containment.parent = root
containment.visible = true containment.visible = true
containment.anchors.fill = root containment.anchors.fill = root

View File

@ -62,7 +62,7 @@ void View::setContainment(Plasma::Containment *cont)
if (graphicObject) { if (graphicObject) {
qDebug() << "using as graphic containment" << graphicObject << m_containment.data(); qDebug() << "using as graphic containment" << graphicObject << m_containment.data();
graphicObject->setProperty("visible", false); //graphicObject->setProperty("visible", false);
graphicObject->setProperty("parent", QVariant::fromValue(rootObject())); graphicObject->setProperty("parent", QVariant::fromValue(rootObject()));
rootObject()->setProperty("containment", QVariant::fromValue(graphicObject)); rootObject()->setProperty("containment", QVariant::fromValue(graphicObject));
} else { } else {