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 <tobias.hunger@qt.io>
This commit is contained in:
Ulf Hermann
2017-03-20 14:31:20 +01:00
committed by Tobias Hunger
parent 5000c7b5f6
commit 23fdc4bddc

View File

@@ -583,18 +583,24 @@ QString Kit::toHtml(const QList<Task> &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