aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/corelib
diff options
context:
space:
mode:
authorIvan Komissarov <abbapoh@gmail.com>2024-03-05 12:28:58 +0300
committerIvan Komissarov <ABBAPOH@gmail.com>2024-03-05 14:44:05 +0000
commit44d658cbf479a597ba22bb661c8ca68d7a98be6d (patch)
treebb6262b0ceec271635163b282773694d1f9a5222 /src/lib/corelib
parent75aca0dca12c6c94109e65ee035b6b533b33a3c5 (diff)
Fix PathLists in Probes
Fixes: QBS-1785 Change-Id: I59e86d9caf80ac1e8870d53d0a91cb88ad0d35b5 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/lib/corelib')
-rw-r--r--src/lib/corelib/loader/probesresolver.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/lib/corelib/loader/probesresolver.cpp b/src/lib/corelib/loader/probesresolver.cpp
index efca2854c..269e9c4b6 100644
--- a/src/lib/corelib/loader/probesresolver.cpp
+++ b/src/lib/corelib/loader/probesresolver.cpp
@@ -198,10 +198,12 @@ void ProbesResolver::resolveProbe(ProductContext &productContext, Item *parent,
if (JsException ex = engine->checkAndClearException({}))
throw ex.toErrorInfo();
newValue = getJsVariant(ctx, v);
- // special case, string lists are represented as js arrays and and we don't type
- // info when converting
- if (decl.type() == PropertyDeclaration::StringList
- && newValue.userType() == QMetaType::QVariantList) {
+ // Special case, string and path lists are represented as js arrays but we don't
+ // want to make them const as we do for object lists. Converting to QStringList
+ // allows to distinguish between these two cases in ScriptEngine::asJsValue
+ if (newValue.userType() == QMetaType::QVariantList
+ && (decl.type() == PropertyDeclaration::StringList
+ || decl.type() == PropertyDeclaration::PathList)) {
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
newValue.convert(QMetaType(QMetaType::QStringList));
#else