diff options
| author | Karsten Heimrich <karsten.heimrich@qt.io> | 2022-11-07 17:13:42 +0100 |
|---|---|---|
| committer | Karsten Heimrich <karsten.heimrich@qt.io> | 2022-11-21 12:56:26 +0000 |
| commit | 4595076682017f61a584fb2d11efe49f728b77c5 (patch) | |
| tree | 602f0d91f097afb774ab6ac65dd4ed0d304ece73 /QtVsTools.Core/QtVersionManager.cs | |
| parent | bd974d32147404ffe69c0d754d7b88025904eb4e (diff) | |
Improve Qt version page
* Fix changing version page in case of error.
* Suppress error message if we try to remove a Qt version
which does not (yet) exist in our registry hive.
* Do Qt version validation a bit earlier so we can report errors
in a timely manner and display a message box to the user.
Fixes: QTVSADDINBUG-1058
Fixes: QTVSADDINBUG-1064
Change-Id: I0523ca8be9245157b9a0e65a5da056f7c79b1e04
Reviewed-by: Miguel Costa <miguel.costa@qt.io>
Diffstat (limited to 'QtVsTools.Core/QtVersionManager.cs')
| -rw-r--r-- | QtVsTools.Core/QtVersionManager.cs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/QtVsTools.Core/QtVersionManager.cs b/QtVsTools.Core/QtVersionManager.cs index 1c85603a..eb398216 100644 --- a/QtVsTools.Core/QtVersionManager.cs +++ b/QtVsTools.Core/QtVersionManager.cs @@ -263,6 +263,14 @@ namespace QtVsTools.Core return true; } + public bool HasVersion(string versionName) + { + if (string.IsNullOrEmpty(versionName)) + return false; + return Registry.CurrentUser.OpenSubKey(Path.Combine("SOFTWARE", regVersionPath, + versionName), false) != null; + } + public void RemoveVersion(string versionName) { var key = Registry.CurrentUser.OpenSubKey("SOFTWARE" + Path.DirectorySeparatorChar |
