diff options
author | Daniel Teske <daniel.teske@digia.com> | 2013-01-14 15:31:49 +0100 |
---|---|---|
committer | Daniel Teske <daniel.teske@digia.com> | 2013-01-15 17:04:16 +0100 |
commit | 104c1f3757b0dc60b3dd2cd3ee9fe4dc09f05557 (patch) | |
tree | d4fa30a0efa238894ae885c500b8bd8b6d49aa1c | |
parent | 6ce9a80afa43b3a40b0244ebef3b41ba03cc76a0 (diff) | |
download | qt-creator-104c1f3757b0dc60b3dd2cd3ee9fe4dc09f05557.tar.gz |
Only show Visual Studio compilers if VS is installed
Task-number: QTCREATORBUG-8487
Change-Id: Ibc812f14cd8e4de765cabf27d23451c06611d372
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
-rw-r--r-- | src/plugins/projectexplorer/msvctoolchain.cpp | 15 | ||||
-rw-r--r-- | src/plugins/projectexplorer/msvctoolchain.h | 2 |
2 files changed, 17 insertions, 0 deletions
diff --git a/src/plugins/projectexplorer/msvctoolchain.cpp b/src/plugins/projectexplorer/msvctoolchain.cpp index a47d1039e0..00aa65d994 100644 --- a/src/plugins/projectexplorer/msvctoolchain.cpp +++ b/src/plugins/projectexplorer/msvctoolchain.cpp @@ -440,6 +440,19 @@ QString MsvcToolChainFactory::id() const return QLatin1String(Constants::MSVC_TOOLCHAIN_ID); } +bool MsvcToolChainFactory::checkForVisualStudioInstallation(const QString &vsName) +{ + const QSettings vsRegistry( +#ifdef Q_OS_WIN64 + QLatin1String("HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\VisualStudio\\SxS\\VS7"), +#else + QLatin1String("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VS7"), +#endif + QSettings::NativeFormat); + + return vsRegistry.contains(vsName); +} + QList<ToolChain *> MsvcToolChainFactory::autoDetect() { QList<ToolChain *> results; @@ -501,6 +514,8 @@ QList<ToolChain *> MsvcToolChainFactory::autoDetect() const int dotPos = vsName.indexOf(QLatin1Char('.')); if (dotPos == -1) continue; + if (!checkForVisualStudioInstallation(vsName)) + continue; const QString path = vsRegistry.value(vsName).toString(); const int version = vsName.left(dotPos).toInt(); diff --git a/src/plugins/projectexplorer/msvctoolchain.h b/src/plugins/projectexplorer/msvctoolchain.h index 8afbf6ebb7..21a0582aaa 100644 --- a/src/plugins/projectexplorer/msvctoolchain.h +++ b/src/plugins/projectexplorer/msvctoolchain.h @@ -106,6 +106,8 @@ public: { return MsvcToolChain::readFromMap(data); } ToolChainConfigWidget *configurationWidget(ToolChain *); +private: + static bool checkForVisualStudioInstallation(const QString &vsName); }; // -------------------------------------------------------------------------- |