diff options
author | Denis Shienkov <denis.shienkov@gmail.com> | 2019-11-14 22:00:48 +0300 |
---|---|---|
committer | Denis Shienkov <denis.shienkov@gmail.com> | 2019-11-15 16:17:02 +0000 |
commit | 52c420c864a8b38c10e634948e428c3c1298dfa5 (patch) | |
tree | 1855eca5847c1b76744283fb70e74171da230ebd /src/app/qbs-setup-toolchains | |
parent | e987dae1d7fda499a8f911f910b645b76c1d72c5 (diff) | |
download | qbs-52c420c864a8b38c10e634948e428c3c1298dfa5.tar.gz |
Don't duplicate "HKLM\\..\\Uninstall" registry key
Change-Id: I3a6f5d200acfec3bf5dd9716be756e15de056279
Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/app/qbs-setup-toolchains')
-rw-r--r-- | src/app/qbs-setup-toolchains/gccprobe.cpp | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/src/app/qbs-setup-toolchains/gccprobe.cpp b/src/app/qbs-setup-toolchains/gccprobe.cpp index 7394acc38..78439cbcb 100644 --- a/src/app/qbs-setup-toolchains/gccprobe.cpp +++ b/src/app/qbs-setup-toolchains/gccprobe.cpp @@ -59,6 +59,9 @@ using namespace qbs; using Internal::HostOsInfo; using Internal::Tr; +constexpr char kUninstallRegistryKey[] = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\" \ + "Windows\\CurrentVersion\\Uninstall\\"; + static QString qsystem(const QString &exe, const QStringList &args = QStringList()) { QProcess p; @@ -279,15 +282,12 @@ static QStringList gnuRegistrySearchPaths() if (!HostOsInfo::isWindowsHost()) return {}; - // Registry token for the "GNU Tools for ARM Embedded Processors". - static const char kRegistryToken[] = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\" \ - "Windows\\CurrentVersion\\Uninstall\\"; - QStringList searchPaths; - QSettings registry(QLatin1String(kRegistryToken), QSettings::NativeFormat); + QSettings registry(QLatin1String(kUninstallRegistryKey), QSettings::NativeFormat); const auto productGroups = registry.childGroups(); for (const QString &productKey : productGroups) { + // Registry token for the "GNU Tools for ARM Embedded Processors". if (!productKey.startsWith( QLatin1String("GNU Tools for ARM Embedded Processors"))) { continue; @@ -393,15 +393,12 @@ static QStringList renesasRl78RegistrySearchPaths() if (!HostOsInfo::isWindowsHost()) return {}; - // Registry token for the "Renesas RL78" toolchain. - static const char kRegistryToken[] = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\" \ - "Windows\\CurrentVersion\\Uninstall"; - QStringList searchPaths; - QSettings registry(QLatin1String(kRegistryToken), QSettings::NativeFormat); + QSettings registry(QLatin1String(kUninstallRegistryKey), QSettings::NativeFormat); const auto productGroups = registry.childGroups(); for (const QString &productKey : productGroups) { + // Registry token for the "Renesas RL78" toolchain. if (!productKey.startsWith( QLatin1String("GCC for Renesas RL78"))) { continue; @@ -428,15 +425,12 @@ static QStringList mplabX32RegistrySearchPaths() if (!HostOsInfo::isWindowsHost()) return {}; - // Registry token for the "MPLAB X32" toolchain. - static const char kRegistryToken[] = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\" \ - "Windows\\CurrentVersion\\Uninstall"; - QStringList searchPaths; - QSettings registry(QLatin1String(kRegistryToken), QSettings::NativeFormat); + QSettings registry(QLatin1String(kUninstallRegistryKey), QSettings::NativeFormat); const auto productGroups = registry.childGroups(); for (const QString &productKey : productGroups) { + // Registry token for the "MPLAB X32" toolchain. if (!productKey.startsWith( QLatin1String("MPLAB XC32 Compiler"))) { continue; |