diff options
author | Bernd Weimer <bernd.weimer@pelagicore.com> | 2019-08-14 15:17:47 +0200 |
---|---|---|
committer | Bernd Weimer <bernd.weimer@pelagicore.com> | 2019-08-19 14:38:18 +0200 |
commit | f086c5e563fe4e414e0b4f2e10a0d071a33692d7 (patch) | |
tree | 8c5b1c4f099b553515d48f45014c6a1c044935eb | |
parent | 1608b6a0a775f3efc0ca8d958f905b3063cc6bfc (diff) |
Fix in-process import path
The QmlInProcessRuntime accepted only import paths in the resource
file system starting with ":", but not with "qrc:".
Change-Id: I324ba08761883b24143945519671b6d24d334e34
Reviewed-by: Robert Griebl <robert.griebl@pelagicore.com>
-rw-r--r-- | src/manager-lib/qmlinprocessruntime.cpp | 2 | ||||
-rw-r--r-- | tests/qml/resources/apps/app1/app1file.qrc | 2 | ||||
-rw-r--r-- | tests/qml/resources/apps/app1/app1plugin.qrc | 2 | ||||
-rw-r--r-- | tests/qml/resources/apps/app1/info.yaml | 4 | ||||
-rw-r--r-- | tests/qml/resources/apps/app1/qml/forms/qmldir | 4 |
5 files changed, 7 insertions, 7 deletions
diff --git a/src/manager-lib/qmlinprocessruntime.cpp b/src/manager-lib/qmlinprocessruntime.cpp index 0cbd9f6a..b4a3beb4 100644 --- a/src/manager-lib/qmlinprocessruntime.cpp +++ b/src/manager-lib/qmlinprocessruntime.cpp @@ -127,7 +127,7 @@ bool QmlInProcessRuntime::start() + variantToStringList(m_app->runtimeParameters().value(qSL("importPaths"))); if (!importPaths.isEmpty()) { for (const QString &path : importPaths) - m_inProcessQmlEngine->addImportPath(QFileInfo(path).isRelative() ? codeDir + path : path); + m_inProcessQmlEngine->addImportPath(toAbsoluteFilePath(path, codeDir)); qCDebug(LogSystem) << "Updated Qml import paths:" << m_inProcessQmlEngine->importPathList(); } diff --git a/tests/qml/resources/apps/app1/app1file.qrc b/tests/qml/resources/apps/app1/app1file.qrc index be8a925f..6c958e89 100644 --- a/tests/qml/resources/apps/app1/app1file.qrc +++ b/tests/qml/resources/apps/app1/app1file.qrc @@ -1,5 +1,5 @@ <!DOCTYPE RCC><RCC version="1.0"> -<qresource> +<qresource prefix="/app1"> <file>app1.qml</file> <file>qml/forms/YellowRect.qml</file> <file>qml/forms/qmldir</file> diff --git a/tests/qml/resources/apps/app1/app1plugin.qrc b/tests/qml/resources/apps/app1/app1plugin.qrc index 6b963fab..6c4e2ae3 100644 --- a/tests/qml/resources/apps/app1/app1plugin.qrc +++ b/tests/qml/resources/apps/app1/app1plugin.qrc @@ -1,5 +1,5 @@ <!DOCTYPE RCC><RCC version="1.0"> -<qresource> +<qresource prefix="/app1"> <file>qml/forms/AquaRect.qml</file> </qresource> </RCC> diff --git a/tests/qml/resources/apps/app1/info.yaml b/tests/qml/resources/apps/app1/info.yaml index 69cf336e..ebf3e533 100644 --- a/tests/qml/resources/apps/app1/info.yaml +++ b/tests/qml/resources/apps/app1/info.yaml @@ -8,9 +8,9 @@ name: applications: - id: 'app1' - code: 'qrc:///app1.qml' + code: 'qrc:///app1/app1.qml' runtime: 'qml' runtimeParameters: - importPaths: "qrc:///qml" + importPaths: "qrc:///app1/qml" resources: [ "app1file.rcc", "libapp1plugin.so" ] diff --git a/tests/qml/resources/apps/app1/qml/forms/qmldir b/tests/qml/resources/apps/app1/qml/forms/qmldir index 50c588d1..12a5506b 100644 --- a/tests/qml/resources/apps/app1/qml/forms/qmldir +++ b/tests/qml/resources/apps/app1/qml/forms/qmldir @@ -1,4 +1,4 @@ module forms -YellowRect 1.0 qrc:///qml/forms/YellowRect.qml -# :/qml/forms/YellowRect.qml would not work +YellowRect 1.0 qrc:///app1/qml/forms/YellowRect.qml +# :/app1/qml/forms/YellowRect.qml would not work AquaRect 1.0 AquaRect.qml |