From 46d4244e01c550f35d7ac065967ca7fdce77d07a Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Wed, 16 Oct 2013 14:31:45 +0200 Subject: [PATCH] Kits: Do not trigger unmanagedKitUpdated signals during construction Stay below the radar during construction/fromMap. This avoids some signals from the KitManager about unmanaged kits having been updated. This signal is used in three places only and always connected only after the the construction happend. So this should be safe. Change-Id: If6cc29b6bb98fa161776a9a79f48f88173db04b8 Reviewed-by: Daniel Teske Reviewed-by: hjk --- src/plugins/projectexplorer/kit.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/plugins/projectexplorer/kit.cpp b/src/plugins/projectexplorer/kit.cpp index d548534cc65..9b78e09458b 100644 --- a/src/plugins/projectexplorer/kit.cpp +++ b/src/plugins/projectexplorer/kit.cpp @@ -107,12 +107,12 @@ public: Kit::Kit(Core::Id id) : d(new Internal::KitPrivate(id)) { - KitGuard g(this); foreach (KitInformation *sti, KitManager::kitInformation()) - setValue(sti->id(), sti->defaultValue(this)); + d->m_data.insert(sti->id(), sti->defaultValue(this)); - setDisplayName(QCoreApplication::translate("ProjectExplorer::Kit", "Unnamed")); - setIconPath(Utils::FileName::fromString(QLatin1String(":///DESKTOP///"))); + d->m_displayName = QCoreApplication::translate("ProjectExplorer::Kit", "Unnamed"); + d->m_iconPath = Utils::FileName::fromString(QLatin1String(":///DESKTOP///")); + d->m_icon = icon(d->m_iconPath); } Kit::~Kit() @@ -461,14 +461,16 @@ bool Kit::fromMap(const QVariantMap &data) d->m_sdkProvided = value.toBool(); else d->m_sdkProvided = d->m_autodetected; - setDisplayName(data.value(QLatin1String(DISPLAYNAME_KEY)).toString()); - setIconPath(Utils::FileName::fromString(data.value(QLatin1String(ICON_KEY)).toString())); + + d->m_displayName = data.value(QLatin1String(DISPLAYNAME_KEY)).toString(); + d->m_iconPath = Utils::FileName::fromString(data.value(QLatin1String(ICON_KEY)).toString()); + d->m_icon = icon(d->m_iconPath); QVariantMap extra = data.value(QLatin1String(DATA_KEY)).toMap(); d->m_data.clear(); // remove default values const QVariantMap::ConstIterator cend = extra.constEnd(); for (QVariantMap::ConstIterator it = extra.constBegin(); it != cend; ++it) - setValue(Id::fromString(it.key()), it.value()); + d->m_data.insert(Id::fromString(it.key()), it.value()); QStringList mutableInfoList = data.value(QLatin1String(MUTABLE_INFO_KEY)).toStringList(); foreach (const QString &mutableInfo, mutableInfoList) {