diff options
author | Miguel Costa <miguel.costa@qt.io> | 2019-11-26 16:46:49 +0100 |
---|---|---|
committer | Miguel Costa <miguel.costa@qt.io> | 2019-12-19 14:11:55 +0000 |
commit | eaec25644b42bbda04a6337f7ad46678097a1910 (patch) | |
tree | 442710330a607acdb467f798e731082026047ec0 /src/qtprojectlib/MsBuildProject.cs | |
parent | ee47ff17cc9b1a8352c9ef9f0cdbd4a6272b0788 (diff) |
Fix setting project keywork during conversion
Fixed a problem where the wrong project keyword tag was overwritten with
the Qt VS project format version, when more than one keyword tag was
present in the original project. Depending on the order of the tags,
the resulting project would contain two keyword tags with different
project format versions.
Task-number: QTVSADDINBUG-702
Change-Id: I343e85a17b9f14971ca414fc57542243021549e2
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'src/qtprojectlib/MsBuildProject.cs')
-rw-r--r-- | src/qtprojectlib/MsBuildProject.cs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/qtprojectlib/MsBuildProject.cs b/src/qtprojectlib/MsBuildProject.cs index 8f3ebf03..8e50b74e 100644 --- a/src/qtprojectlib/MsBuildProject.cs +++ b/src/qtprojectlib/MsBuildProject.cs @@ -309,7 +309,11 @@ namespace QtProjectLib .ToDictionary(pg => (string)pg.Attribute("Condition")); // Set Qt project format version - var projKeyword = globals.Element(ns + "Keyword"); + var projKeyword = globals + .Elements(ns + "Keyword") + .Where(x => x.Value.StartsWith(Resources.qtProjectKeyword) + || x.Value.StartsWith(Resources.qtProjectV2Keyword)) + .FirstOrDefault(); if (projKeyword == null) return false; var oldVersion = ParseProjectFormatVersion(projKeyword.Value); |