From 23fdc4bddc25966f59d91354262c6c7aeb96489f Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Mon, 20 Mar 2017 14:31:20 +0100 Subject: [PATCH] ProjectExplorer: Don't call kitUpdated() if nothing has changed Otherwise this can lead to infinite recursion. The android integration reacts to kit changes by examining the available Qt versions and creating additional android kits. This crashes, eventually. Also, kitUpdated() is rather expensive, so we shouldn't call it if we don't have to. Change-Id: Ic5fe26f6b174c5b96a6ed8280bf744bf642863b2 Reviewed-by: Tobias Hunger --- src/plugins/projectexplorer/kit.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/plugins/projectexplorer/kit.cpp b/src/plugins/projectexplorer/kit.cpp index 4fc619d1f42..c6fb97cffed 100644 --- a/src/plugins/projectexplorer/kit.cpp +++ b/src/plugins/projectexplorer/kit.cpp @@ -583,18 +583,24 @@ QString Kit::toHtml(const QList &additional) const void Kit::setAutoDetected(bool detected) { + if (d->m_autodetected == detected) + return; d->m_autodetected = detected; kitUpdated(); } void Kit::setAutoDetectionSource(const QString &autoDetectionSource) { + if (d->m_autoDetectionSource == autoDetectionSource) + return; d->m_autoDetectionSource = autoDetectionSource; kitUpdated(); } void Kit::setSdkProvided(bool sdkProvided) { + if (d->m_sdkProvided == sdkProvided) + return; d->m_sdkProvided = sdkProvided; kitUpdated(); } @@ -609,6 +615,9 @@ void Kit::makeSticky() void Kit::setSticky(Id id, bool b) { + if (d->m_sticky.contains(id) == b) + return; + if (b) d->m_sticky.insert(id); else @@ -618,12 +627,17 @@ void Kit::setSticky(Id id, bool b) void Kit::makeUnSticky() { + if (d->m_sticky.isEmpty()) + return; d->m_sticky.clear(); kitUpdated(); } void Kit::setMutable(Id id, bool b) { + if (d->m_mutable.contains(id) == b) + return; + if (b) d->m_mutable.insert(id); else