try to use a simple incubator to make loading appear smooter
This commit is contained in:
parent
0a587eae5e
commit
82930e7226
@ -23,6 +23,7 @@
|
||||
#include <QQmlComponent>
|
||||
#include <QQmlEngine>
|
||||
#include <QQmlContext>
|
||||
#include <QQmlIncubator>
|
||||
#include <QTimer>
|
||||
|
||||
#include <kdebug.h>
|
||||
@ -184,7 +185,14 @@ void QmlObject::completeInitialization()
|
||||
return;
|
||||
}
|
||||
|
||||
d->root = d->component->create();
|
||||
QQmlIncubator incubator;
|
||||
d->component->create(incubator);
|
||||
|
||||
while (!incubator.isReady() && incubator.status() != QQmlIncubator::Error) {
|
||||
QCoreApplication::processEvents(QEventLoop::AllEvents, 50);
|
||||
}
|
||||
|
||||
d->root = incubator.object();
|
||||
|
||||
if (!d->root) {
|
||||
d->errorPrint();
|
||||
|
@ -126,9 +126,7 @@ bool DeclarativeAppletScript::init()
|
||||
|
||||
Plasma::Applet *a = applet();
|
||||
|
||||
Plasma::Containment *cont = qobject_cast<Plasma::Containment *>(a);
|
||||
|
||||
if (cont) {
|
||||
if (pc) {
|
||||
m_interface = new ContainmentInterface(this);
|
||||
//fail? so it's a normal Applet
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user