containments emit uiready only when all applets did
This commit is contained in:
parent
0d9bc6d7be
commit
ebdfbb2e25
@ -185,7 +185,21 @@ void AppletInterface::init()
|
||||
}
|
||||
geometryChanged(QRectF(), QRectF(x(), y(), width(), height()));
|
||||
emit busyChanged();
|
||||
|
||||
if (!qobject_cast<Plasma::Containment *>(applet())) {
|
||||
m_appletScriptEngine->setUiReady(true);
|
||||
|
||||
ContainmentInterface *containmentGraphicObject = qobject_cast<ContainmentInterface *>(applet()->containment()->property("graphicObject").value<QObject *>());
|
||||
|
||||
if (containmentGraphicObject) {
|
||||
DeclarativeAppletScript *containmentScript = containmentGraphicObject->m_appletScriptEngine;
|
||||
|
||||
containmentScript->m_inProgressAppletInterfaces.remove(this);
|
||||
if (containmentScript->m_inProgressAppletInterfaces.isEmpty()) {
|
||||
containmentScript->setUiReady(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Plasma::Types::FormFactor AppletInterface::formFactor() const
|
||||
|
@ -82,6 +82,9 @@ void ContainmentInterface::init()
|
||||
if (!m_appletInterfaces.isEmpty()) {
|
||||
emit appletsChanged();
|
||||
}
|
||||
if (m_appletScriptEngine->m_inProgressAppletInterfaces.isEmpty()) {
|
||||
m_appletScriptEngine->setUiReady(true);
|
||||
}
|
||||
}
|
||||
|
||||
QList <QObject *> ContainmentInterface::applets()
|
||||
@ -173,6 +176,7 @@ void ContainmentInterface::appletAddedForward(Plasma::Applet *applet)
|
||||
}
|
||||
|
||||
m_appletInterfaces << appletGraphicObject;
|
||||
m_appletScriptEngine->m_inProgressAppletInterfaces.insert(appletGraphicObject);
|
||||
emit appletAdded(appletGraphicObject);
|
||||
emit appletsChanged();
|
||||
}
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include <kdemacros.h>
|
||||
|
||||
#include <QQmlEngine>
|
||||
#include <QSet>
|
||||
|
||||
#include <Plasma/AppletScript>
|
||||
|
||||
@ -64,7 +65,9 @@ Q_SIGNALS:
|
||||
private:
|
||||
AppletInterface *m_interface;
|
||||
bool m_uiReady;
|
||||
QSet<QObject *> m_inProgressAppletInterfaces;
|
||||
friend class AppletInterface;
|
||||
friend class ContainmentInterface;
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user