summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@digia.com>2013-08-12 12:02:27 +0200
committerJoerg Bornemann <joerg.bornemann@digia.com>2013-08-13 10:40:19 +0200
commit8fca292534a2198a83cb01e085dd6e3071930c51 (patch)
treeefa82350ee784d55619193ea5e34858e5c882072 /src/lib
parentd91b568f9c452332006ffbedc87a9e7e2d77012e (diff)
downloadqbs-8fca292534a2198a83cb01e085dd6e3071930c51.tar.gz
Don't check for QVariant::isValid() when setting up observed properties.
An invalid QVariant can be the result of an undefined property, whose uses still need to be tracked. Change-Id: I66c74ae0a36b2f597a2774221bafac7fb3e994d8 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/buildgraph/buildgraph.cpp4
-rw-r--r--src/lib/language/projectresolver.cpp4
2 files changed, 6 insertions, 2 deletions
diff --git a/src/lib/buildgraph/buildgraph.cpp b/src/lib/buildgraph/buildgraph.cpp
index 4f0648d39..d382384be 100644
--- a/src/lib/buildgraph/buildgraph.cpp
+++ b/src/lib/buildgraph/buildgraph.cpp
@@ -153,10 +153,10 @@ static void setupProductScriptValue(ScriptEngine *engine, QScriptValue &productS
const QVariantMap &propMap = product->properties->value();
for (QVariantMap::ConstIterator it = propMap.constBegin(); it != propMap.constEnd(); ++it) {
const QVariant &value = it.value();
- if (value.isValid()
- && (!value.canConvert<QVariantMap>() || it.key() != QLatin1String("modules")))
+ if (!value.canConvert<QVariantMap>() || it.key() != QLatin1String("modules")) {
engine->setObservedProperty(productScriptValue, it.key(),
engine->toScriptValue(value), observer);
+ }
}
}
diff --git a/src/lib/language/projectresolver.cpp b/src/lib/language/projectresolver.cpp
index 75c549e31..ead9a0a55 100644
--- a/src/lib/language/projectresolver.cpp
+++ b/src/lib/language/projectresolver.cpp
@@ -837,7 +837,11 @@ QVariantMap ProjectResolver::evaluateProperties(Item *item,
const QScriptValue scriptValue = m_evaluator->property(item, it.key());
if (Q_UNLIKELY(scriptValue.isError()))
throw ErrorInfo(scriptValue.toString(), it.value()->location());
+
+ // NOTE: Loses type information if scriptValue.isUndefined == true,
+ // as such QScriptValues become invalid QVariants.
QVariant v = scriptValue.toVariant();
+
if (pd.type == PropertyDeclaration::Path)
v = convertPathProperty(v.toString(),
m_productContext->product->sourceDirectory);