aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2020-08-21 13:46:50 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2020-08-24 11:19:15 +0000
commit7f424ec15884e23ef56c7781f0a8de02ed016ae1 (patch)
tree096c118e13a5fa9b9cdbf6fa7bab8369be8354e0 /src
parent450ccbdf8b9981d91980fd8917f428949129559d (diff)
Introduce an "exportingProduct" variable
... for use in Export items. It's not obvious that "product" refers to the exporting product, and in fact setting it up this way pollutes the scope for modules loaded via Export items. Therefore, we introduce exportingProduct for symmetry with importingProduct. [ChangeLog] Deprecate the product variable inside Export items in favor of the new exportingProduct variable. Task-number: QBS-1576 Change-Id: Ie91752d1ae2160cb7701ae0167bccde0cd5c0e5d Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/lib/corelib/language/moduleloader.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/lib/corelib/language/moduleloader.cpp b/src/lib/corelib/language/moduleloader.cpp
index f39e46447..e1044d2a5 100644
--- a/src/lib/corelib/language/moduleloader.cpp
+++ b/src/lib/corelib/language/moduleloader.cpp
@@ -3481,13 +3481,14 @@ void ModuleLoader::instantiateModule(ProductContext *productContext, Item *expor
}
if (exportingProduct) {
- // TODO: For consistency with modules, it should be the other way around, i.e.
- // "exportingProduct" and just "product".
- moduleScope->setProperty(StringConstants::productVar(),
- ItemValue::create(exportingProduct));
+ const auto exportingProductItemValue = ItemValue::create(exportingProduct);
+ moduleScope->setProperty(QStringLiteral("exportingProduct"), exportingProductItemValue);
moduleScope->setProperty(QStringLiteral("importingProduct"),
ItemValue::create(productContext->item));
+ // TODO: Remove in 1.20.
+ moduleScope->setProperty(StringConstants::productVar(), exportingProductItemValue);
+
moduleScope->setProperty(StringConstants::projectVar(),
ItemValue::create(exportingProduct->parent()));