From 4ac80fe3a0c18af83a22d650be46e10911995b91 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Wed, 6 Jul 2016 14:13:25 +0200 Subject: [PATCH] ToolChains: Trigger ToolChainManager::toolChainChanged signal Trigger ToolChainManager::toolChainChanged signal when something changes. This was apparently missing in quite a few places of some of the tool chains. Change-Id: Ic94c6559e6267f4ff22dc74cc5b0865fb7aeac63 Reviewed-by: Christian Kandeler --- src/plugins/android/androidtoolchain.cpp | 3 +++ .../projectexplorer/customtoolchain.cpp | 26 ++++++++++++++++--- src/plugins/projectexplorer/gcctoolchain.cpp | 9 +++++++ src/plugins/qnx/qnxtoolchain.cpp | 3 +++ 4 files changed, 38 insertions(+), 3 deletions(-) diff --git a/src/plugins/android/androidtoolchain.cpp b/src/plugins/android/androidtoolchain.cpp index 81ce2350cf3..8894118436d 100644 --- a/src/plugins/android/androidtoolchain.cpp +++ b/src/plugins/android/androidtoolchain.cpp @@ -231,7 +231,10 @@ bool AndroidToolChain::isSecondaryToolChain() const void AndroidToolChain::setSecondaryToolChain(bool b) { + if (m_secondaryToolChain == b) + return; m_secondaryToolChain = b; + toolChainUpdated(); } GccToolChain::DetectedAbisResult AndroidToolChain::detectSupportedAbis() const diff --git a/src/plugins/projectexplorer/customtoolchain.cpp b/src/plugins/projectexplorer/customtoolchain.cpp index a910450113d..e14562ca1b6 100644 --- a/src/plugins/projectexplorer/customtoolchain.cpp +++ b/src/plugins/projectexplorer/customtoolchain.cpp @@ -164,7 +164,10 @@ const QStringList &CustomToolChain::rawPredefinedMacros() const void CustomToolChain::setPredefinedMacros(const QStringList &list) { + if (m_predefinedMacros == list) + return; m_predefinedMacros = list; + toolChainUpdated(); } QList CustomToolChain::systemHeaderPaths(const QStringList &cxxFlags, const FileName &) const @@ -215,9 +218,14 @@ QStringList CustomToolChain::headerPathsList() const void CustomToolChain::setHeaderPaths(const QStringList &list) { - m_systemHeaderPaths = Utils::transform(list, [](const QString &headerPath) { + QList tmp = Utils::transform(list, [](const QString &headerPath) { return HeaderPath(headerPath.trimmed(), HeaderPath::GlobalHeaderPath); }); + + if (m_systemHeaderPaths == tmp) + return; + m_systemHeaderPaths = tmp; + toolChainUpdated(); } void CustomToolChain::setCompilerCommand(const FileName &path) @@ -261,8 +269,14 @@ const QStringList &CustomToolChain::cxx11Flags() const void CustomToolChain::setMkspecs(const QString &specs) { - m_mkspecs = Utils::transform(specs.split(QLatin1Char(',')), - [](QString fn) { return FileName::fromString(fn); }); + Utils::FileNameList tmp + = Utils::transform(specs.split(QLatin1Char(',')), + [](QString fn) { return FileName::fromString(fn); }); + + if (tmp == m_mkspecs) + return; + m_mkspecs = tmp; + toolChainUpdated(); } QString CustomToolChain::mkspecs() const @@ -367,7 +381,10 @@ CustomToolChain::OutputParser CustomToolChain::outputParserType() const void CustomToolChain::setOutputParserType(CustomToolChain::OutputParser parser) { + if (m_outputParser == parser) + return; m_outputParser = parser; + toolChainUpdated(); } CustomParserSettings CustomToolChain::customParserSettings() const @@ -377,7 +394,10 @@ CustomParserSettings CustomToolChain::customParserSettings() const void CustomToolChain::setCustomParserSettings(const CustomParserSettings &settings) { + if (m_customParserSettings == settings) + return; m_customParserSettings = settings; + toolChainUpdated(); } QString CustomToolChain::parserName(CustomToolChain::OutputParser parser) diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index dd055755aee..cc328d57af1 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -230,16 +230,25 @@ void GccToolChain::setCompilerCommand(const FileName &path) return; m_compilerCommand = path; + toolChainUpdated(); } void GccToolChain::setSupportedAbis(const QList &m_abis) { + if (m_supportedAbis == m_abis) + return; + m_supportedAbis = m_abis; + toolChainUpdated(); } void GccToolChain::setOriginalTargetTriple(const QString &targetTriple) { + if (m_originalTargetTriple == targetTriple) + return; + m_originalTargetTriple = targetTriple; + toolChainUpdated(); } void GccToolChain::setMacroCache(const QStringList &allCxxflags, const QByteArray ¯os) const diff --git a/src/plugins/qnx/qnxtoolchain.cpp b/src/plugins/qnx/qnxtoolchain.cpp index ad0cd53e184..6eda4a2e7a8 100644 --- a/src/plugins/qnx/qnxtoolchain.cpp +++ b/src/plugins/qnx/qnxtoolchain.cpp @@ -114,7 +114,10 @@ QString QnxToolChain::ndkPath() const void QnxToolChain::setNdkPath(const QString &ndkPath) { + if (m_ndkPath == ndkPath) + return; m_ndkPath = ndkPath; + toolChainUpdated(); } // qcc doesn't support a "-dumpmachine" option to get supported abis