summaryrefslogtreecommitdiff
path: root/src/lib/buildgraph
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@digia.com>2013-06-07 10:58:40 +0200
committerChristian Kandeler <christian.kandeler@digia.com>2013-06-07 15:21:49 +0200
commit0a70dce41160783c726f822eff81ae30b83acfdc (patch)
tree94dcf0c2aa5995084dcfba9999c803ef883ea9bc /src/lib/buildgraph
parent46dde94890f89299cbad4097d82fdb9051fbbcef (diff)
downloadqbs-0a70dce41160783c726f822eff81ae30b83acfdc.tar.gz
fix checkForPropertyChanges for product values
checkForPropertyChanges always returned true, because we stored tracked product properties with the module name "product". Introduce the enum Property::Kind instead of abusing the module name. Task-number: QBS-305 Change-Id: I51a1eb28f0bb3245d7e926685f3a0fe01f981959 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
Diffstat (limited to 'src/lib/buildgraph')
-rw-r--r--src/lib/buildgraph/buildgraph.cpp4
-rw-r--r--src/lib/buildgraph/rulesapplicator.cpp3
-rw-r--r--src/lib/buildgraph/transformer.cpp6
3 files changed, 9 insertions, 4 deletions
diff --git a/src/lib/buildgraph/buildgraph.cpp b/src/lib/buildgraph/buildgraph.cpp
index 6a049083f..b8ae692df 100644
--- a/src/lib/buildgraph/buildgraph.cpp
+++ b/src/lib/buildgraph/buildgraph.cpp
@@ -769,7 +769,9 @@ bool BuildGraphLoader::checkForPropertyChanges(const TransformerPtr &restoredTra
PropertyFinder finder;
foreach (const Property &property, restoredTrafo->modulePropertiesUsedInPrepareScript) {
QVariant v;
- if (property.value.type() == QVariant::List) {
+ if (property.kind == Property::PropertyInProduct) {
+ v = freshProduct->properties->value().value(property.propertyName);
+ } else if (property.value.type() == QVariant::List) {
v = finder.propertyValues(freshProduct->properties->value(), property.moduleName,
property.propertyName);
} else {
diff --git a/src/lib/buildgraph/rulesapplicator.cpp b/src/lib/buildgraph/rulesapplicator.cpp
index b5ec6ffde..96054c328 100644
--- a/src/lib/buildgraph/rulesapplicator.cpp
+++ b/src/lib/buildgraph/rulesapplicator.cpp
@@ -328,7 +328,8 @@ void RulesApplicator::onPropertyRead(const QScriptValue &object, const QString &
const QScriptValue &value)
{
if (object.objectId() == m_productObjectId)
- engine()->addProperty(Property(QLatin1String("product"), name, value.toVariant()));
+ engine()->addProperty(
+ Property(QString(), name, value.toVariant(), Property::PropertyInProduct));
}
} // namespace Internal
diff --git a/src/lib/buildgraph/transformer.cpp b/src/lib/buildgraph/transformer.cpp
index 27ee4af5d..4b2c777cf 100644
--- a/src/lib/buildgraph/transformer.cpp
+++ b/src/lib/buildgraph/transformer.cpp
@@ -180,7 +180,9 @@ void Transformer::load(PersistentPool &pool)
Property p;
p.moduleName = pool.idLoadString();
p.propertyName = pool.idLoadString();
- pool.stream() >> p.value;
+ int k;
+ pool.stream() >> p.value >> k;
+ p.kind = static_cast<Property::Kind>(k);
modulePropertiesUsedInPrepareScript += p;
}
int cmdType;
@@ -203,7 +205,7 @@ void Transformer::store(PersistentPool &pool) const
foreach (const Property &p, modulePropertiesUsedInPrepareScript) {
pool.storeString(p.moduleName);
pool.storeString(p.propertyName);
- pool.stream() << p.value;
+ pool.stream() << p.value << static_cast<int>(p.kind);
}
pool.stream() << commands.count();
foreach (AbstractCommand *cmd, commands) {