aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2017-07-24 10:59:47 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2017-07-27 09:15:18 +0000
commitff1eb8f5865475b8e161fd81c82ca891264de4ff (patch)
tree82ff87fc6c376159afb60db42835c0842cfa9b4a
parentf717ea6ebadf4d3f6225f80a9436bef2af12393d (diff)
Fix glitch with new module property access syntax
There was a problem with multi-component module names: It was not possible to use constructs like 'input["Qt.core"].x', which made it practically impossible to pass module names in variables and use these to access properties. Change-Id: Ic200ba2dcfd4abba51a5ed84cf67a3e090c11d7c Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
-rw-r--r--src/lib/corelib/jsextensions/moduleproperties.cpp2
-rw-r--r--tests/auto/blackbox/testdata-qt/qtscxml/qtscxml.qbs4
2 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/corelib/jsextensions/moduleproperties.cpp b/src/lib/corelib/jsextensions/moduleproperties.cpp
index c9b17c855..3aab2c067 100644
--- a/src/lib/corelib/jsextensions/moduleproperties.cpp
+++ b/src/lib/corelib/jsextensions/moduleproperties.cpp
@@ -194,6 +194,8 @@ void ModuleProperties::setupModules(QScriptValue &object, const ResolvedProductC
obj = tmp;
}
obj.setProperty(moduleName.last(), moduleObject);
+ if (moduleName.count() > 1)
+ object.setProperty(moduleName.toString(), moduleObject);
}
}
diff --git a/tests/auto/blackbox/testdata-qt/qtscxml/qtscxml.qbs b/tests/auto/blackbox/testdata-qt/qtscxml/qtscxml.qbs
index 9610825ec..6cbeb9b2f 100644
--- a/tests/auto/blackbox/testdata-qt/qtscxml/qtscxml.qbs
+++ b/tests/auto/blackbox/testdata-qt/qtscxml/qtscxml.qbs
@@ -39,10 +39,10 @@ Project {
var pathValue;
if (product.qbs.hostOS.contains("windows")) {
pathVar = "PATH";
- pathValue = FileInfo.toWindowsSeparators(input.Qt.core.binPath);
+ pathValue = FileInfo.toWindowsSeparators(input["Qt.core"].binPath);
} else {
pathVar = "LD_LIBRARY_PATH";
- pathValue = input.Qt.core.libPath;
+ pathValue = input["Qt.core"].libPath;
}
var oldValue = Environment.getEnv(pathVar) || "";
var newValue = pathValue + product.qbs.pathListSeparator + oldValue;