summaryrefslogtreecommitdiff
path: root/src/lib/buildgraph/buildgraph.cpp
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@digia.com>2013-02-21 14:20:03 +0100
committerJoerg Bornemann <joerg.bornemann@digia.com>2013-02-21 15:12:26 +0100
commit760b9c319dc156b76d7a6af0d27fd1b7242cd9fd (patch)
tree464988ad3a8abff8e4e4094046229daf78783df8 /src/lib/buildgraph/buildgraph.cpp
parent8fdd05ac18c0aa40c26da56e976bd4f46c01d047 (diff)
downloadqbs-760b9c319dc156b76d7a6af0d27fd1b7242cd9fd.tar.gz
Fix accessing product properties via the "product" property.
Also add an autotest for this. Change-Id: If4d3bf50eee4d77dcac12c1cf574dc08780c3dae Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Diffstat (limited to 'src/lib/buildgraph/buildgraph.cpp')
-rw-r--r--src/lib/buildgraph/buildgraph.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/lib/buildgraph/buildgraph.cpp b/src/lib/buildgraph/buildgraph.cpp
index 30bb71b16..1f43edbb1 100644
--- a/src/lib/buildgraph/buildgraph.cpp
+++ b/src/lib/buildgraph/buildgraph.cpp
@@ -86,8 +86,15 @@ void setupScriptEngineForProduct(ScriptEngine *engine, const ResolvedProductCons
if (destinationDirectory.isEmpty())
destinationDirectory = ".";
productScriptValue.setProperty("destinationDirectory", destinationDirectory);
+
exportProperty(product, productScriptValue, engine, "type");
exportProperty(product, productScriptValue, engine, "consoleApplication");
+ const QVariantMap &propMap = product->properties->value();
+ for (QVariantMap::ConstIterator it = propMap.constBegin(); it != propMap.constEnd(); ++it) {
+ if (!it.value().canConvert<QVariantMap>())
+ productScriptValue.setProperty(it.key(), engine->toScriptValue(it.value()));
+ }
+
targetObject.setProperty("product", productScriptValue);
} else {
productScriptValue = targetObject.property("product");