add the import paths right into libkdeclarative
This commit is contained in:
parent
a70c17bc59
commit
71ad31df23
@ -94,13 +94,14 @@ void DeclarativeWidgetPrivate::execute(const QString &fileName)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
component->loadUrl(fileName);
|
|
||||||
|
|
||||||
KDeclarative kdeclarative;
|
KDeclarative kdeclarative;
|
||||||
kdeclarative.setDeclarativeEngine(engine);
|
kdeclarative.setDeclarativeEngine(engine);
|
||||||
kdeclarative.initialize();
|
kdeclarative.initialize();
|
||||||
//binds things like kconfig and icons
|
//binds things like kconfig and icons
|
||||||
kdeclarative.setupBindings();
|
kdeclarative.setupBindings();
|
||||||
|
|
||||||
|
component->loadUrl(fileName);
|
||||||
|
|
||||||
scriptEngine = kdeclarative.scriptEngine();
|
scriptEngine = kdeclarative.scriptEngine();
|
||||||
registerDataEngineMetaTypes(scriptEngine);
|
registerDataEngineMetaTypes(scriptEngine);
|
||||||
|
|
||||||
@ -194,9 +195,6 @@ DeclarativeWidget::DeclarativeWidget(QGraphicsWidget *parent)
|
|||||||
|
|
||||||
d->engine = new QDeclarativeEngine(this);
|
d->engine = new QDeclarativeEngine(this);
|
||||||
d->engine->setNetworkAccessManagerFactory(new DeclarativeNetworkAccessManagerFactory);
|
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);
|
d->component = new QDeclarativeComponent(d->engine, this);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user