From 71ad31df234f8fdd8c43c525c707017de05301ce Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Tue, 8 Nov 2011 17:19:47 +0100 Subject: [PATCH] add the import paths right into libkdeclarative --- widgets/declarativewidget.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/widgets/declarativewidget.cpp b/widgets/declarativewidget.cpp index 9ad2a436c..878164efa 100644 --- a/widgets/declarativewidget.cpp +++ b/widgets/declarativewidget.cpp @@ -94,13 +94,14 @@ void DeclarativeWidgetPrivate::execute(const QString &fileName) return; } - component->loadUrl(fileName); - KDeclarative kdeclarative; kdeclarative.setDeclarativeEngine(engine); kdeclarative.initialize(); //binds things like kconfig and icons kdeclarative.setupBindings(); + + component->loadUrl(fileName); + scriptEngine = kdeclarative.scriptEngine(); registerDataEngineMetaTypes(scriptEngine); @@ -194,9 +195,6 @@ DeclarativeWidget::DeclarativeWidget(QGraphicsWidget *parent) d->engine = new QDeclarativeEngine(this); d->engine->setNetworkAccessManagerFactory(new DeclarativeNetworkAccessManagerFactory); - foreach(const QString &importPath, KGlobal::dirs()->findDirs("module", "imports")) { - d->engine->addImportPath(importPath); - } d->component = new QDeclarativeComponent(d->engine, this); }