diff options
author | Ali Can Demiralp <ali.demiralp@qt.io> | 2024-03-06 02:30:30 +0100 |
---|---|---|
committer | Ali Can Demiralp <ali.demiralp@qt.io> | 2024-03-14 13:06:22 +0000 |
commit | fe708a9d6173e8a960303511ac792f5f129ec1f2 (patch) | |
tree | 7b5153ec186451aafec934da28bb645607b9d464 | |
parent | 39f157cd6b3684915e6ade14ee479c9a8b92289a (diff) |
Avoid modifying .vcxproj.user
Removed QtLastBackgroundBuild, which was a property that was written,
but never read, and had the sole purpose of triggering an update to
MOC/UIC/... as well as IntelliSense. Replaced it with QtTouchProperty,
which serves the same purpose, but without modifying the .vcxproj.user.
Added comments clarifying its purpose to avoid unintentional refactoring
in the future.
Fixes: QTVSADDINBUG-935
Change-Id: I4d72c9930f07b121fe6437965e7c082b335cf34a
Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
-rw-r--r-- | QtMSBuild/QtMsBuild/qt_settings.xml | 4 | ||||
-rw-r--r-- | QtVsTools.Core/MsBuild/MsBuildProject.Build.cs | 9 | ||||
-rw-r--r-- | QtVsTools.Package/Package/DteEventsHandler.cs | 2 |
3 files changed, 10 insertions, 5 deletions
diff --git a/QtMSBuild/QtMsBuild/qt_settings.xml b/QtMSBuild/QtMsBuild/qt_settings.xml index 680ab78e..54eb3734 100644 --- a/QtMSBuild/QtMsBuild/qt_settings.xml +++ b/QtMSBuild/QtMsBuild/qt_settings.xml @@ -41,8 +41,8 @@ <EnumValue Name="QtVS_v304" DisplayName="Version 3.4"/> </EnumProperty> <StringProperty - Name="QtLastBackgroundBuild" - DisplayName="Last Background Build" + Name="QtTouchProperty" + DisplayName="Touch Property" Category="QtSettings_01_General" Visible="False"> <StringProperty.DataSource> diff --git a/QtVsTools.Core/MsBuild/MsBuildProject.Build.cs b/QtVsTools.Core/MsBuild/MsBuildProject.Build.cs index 9b9e4f32..a70caf72 100644 --- a/QtVsTools.Core/MsBuild/MsBuildProject.Build.cs +++ b/QtVsTools.Core/MsBuild/MsBuildProject.Build.cs @@ -339,11 +339,16 @@ namespace QtVsTools.Core.MsBuild } if (ok) { + // Hack: Modify the QtTouchProperty in the project user file to trigger an + // update to MOC/UIC/... as well as IntelliSense. Revert it immediately to avoid + // changing the project user file. var vcConfigs = item.VcProject.Configurations as IVCCollection; var vcConfig = vcConfigs?.Item(item.ConfiguredProject.ProjectConfiguration.Name) as VCConfiguration; - var props = vcConfig?.Rules.Item("QtRule10_Settings") as IVCRulePropertyStorage; - props?.SetPropertyValue("QtLastBackgroundBuild", DateTime.UtcNow.ToString("o")); + if (vcConfig?.Rules.Item("QtRule10_Settings") is IVCRulePropertyStorage props) { + props.SetPropertyValue("QtTouchProperty", " "); + props.SetPropertyValue("QtTouchProperty", ""); + } } } catch (Exception e) { Messages.Print($"{Path.GetFileName(item.UnconfiguredProject.FullPath)}: " diff --git a/QtVsTools.Package/Package/DteEventsHandler.cs b/QtVsTools.Package/Package/DteEventsHandler.cs index 3fd6c7d9..3e77e6f3 100644 --- a/QtVsTools.Package/Package/DteEventsHandler.cs +++ b/QtVsTools.Package/Package/DteEventsHandler.cs @@ -402,7 +402,7 @@ namespace QtVsTools if (MsBuildProject.GetOrAdd(vcConfiguration.project as VCProject) is not {} project) return; - if (!propertyName.StartsWith("Qt") || propertyName == "QtLastBackgroundBuild") + if (!propertyName.StartsWith("Qt") || propertyName == "QtTouchProperty") return; project.Refresh(vcConfiguration.Name); |