aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarsten Heimrich <karsten.heimrich@qt.io>2023-12-19 10:55:17 +0100
committerKarsten Heimrich <karsten.heimrich@qt.io>2024-01-08 09:45:08 +0000
commitd296e8fe34d040dc38d1f83420e922a4aac40e99 (patch)
treebc85d1d2333320861736d699216b27118764e510
parentd24c7dc54606c2cb52645dd70dbc11606a9382d9 (diff)
$(QTDIR) or $(DefaultQtVersion) cannot be used as version name
Because of the way these special identifiers in Qt Version managers are processed, we cannot allow them to be used as the version name. Both trigger path resolution and do not lead to the actual installation that was originally associated with the name. Change-Id: I793b1cc728d48f81bce6e0f0c474125b67ccc4a5 Reviewed-by: Miguel Costa <miguel.costa@qt.io>
-rw-r--r--QtVsTools.Core/Options/QtVersionsTable.cs2
1 files changed, 2 insertions, 0 deletions
diff --git a/QtVsTools.Core/Options/QtVersionsTable.cs b/QtVsTools.Core/Options/QtVersionsTable.cs
index 76590fd9..fedf542b 100644
--- a/QtVsTools.Core/Options/QtVersionsTable.cs
+++ b/QtVsTools.Core/Options/QtVersionsTable.cs
@@ -228,6 +228,8 @@ namespace QtVsTools.Core.Options
version.FieldVersionName.ValidationError = null;
if (string.IsNullOrEmpty(version.VersionName)) {
version.FieldVersionName.ValidationError = "Name cannot be empty";
+ } else if (version.VersionName.ToUpperInvariant() is "$(QTDIR)" or "$(DEFAULTQTVERSION)") {
+ version.FieldVersionName.ValidationError = $"Name cannot be '{version.VersionName}'";
} else if (Versions.Any(existing => existing != version
&& existing.VersionName == version.VersionName
&& existing.State != State.Removed)) {