[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: =?utf-8?q?=5Bgluon=5D_engine/components/graphics=3A_Make_sure_to?=
From: Arjen <ahiemstra () heimr ! nl>
Date: 2011-02-06 11:59:16
Message-ID: 20110206115916.4CD6FA60D5 () git ! kde ! org
[Download RAW message or body]
Git commit 919a376d775ac94bcbc2f2668a87b557d93b8b05 by Arjen.
Committed on 05/02/11 at 20:25.
Pushed by ahiemstra into branch 'master'.
Make sure to always call the setScriptEngine hack.
This avoids a crash when resetting the scene or creating
a second UiManagerComponent with the asme UiAsset.
M +9 -6 engine/components/graphics/uimanager/uimanagercomponent.cpp
http://commits.kde.org/gluon/919a376d775ac94bcbc2f2668a87b557d93b8b05
diff --git a/engine/components/graphics/uimanager/uimanagercomponent.cpp \
b/engine/components/graphics/uimanager/uimanagercomponent.cpp index d926f02..cf202f3 \
100644
--- a/engine/components/graphics/uimanager/uimanagercomponent.cpp
+++ b/engine/components/graphics/uimanager/uimanagercomponent.cpp
@@ -186,13 +186,16 @@ void UiManagerComponent::initialize()
this, SLOT( resizeQmlItem( const QRectF& ) ) );
}
- if( d->ui && !d->ui->isLoaded() )
+ if( d->ui )
{
- qmlRegisterType<GluonEngine::GameObject>("org.kde.gluon", 1, 0, "GameObject" \
);
- qmlRegisterInterface<GluonEngine::GameObject>("gameObject");
-
- d->ui->load();
+ if(!d->ui->isLoaded())
+ {
+ qmlRegisterType<GluonEngine::GameObject>("org.kde.gluon", 1, 0, \
"GameObject" ); + \
qmlRegisterInterface<GluonEngine::GameObject>("gameObject");
+ d->ui->load();
+ }
+
QDeclarativeEngine* engine = d->ui->engine();
d->engineAccess = new EngineAccess(this);
@@ -200,7 +203,7 @@ void UiManagerComponent::initialize()
//Glorious hack:steal the engine
QDeclarativeExpression *expr = new QDeclarativeExpression( \
engine->rootContext(), 0,
- \
"__engineAccess.setEngine( this )" ); + \
"__engineAccess.setEngine( this )" ); expr->evaluate();
delete expr;
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic