Commit aedc4d6e authored by Daniel Teske's avatar Daniel Teske Committed by Tobias Hunger

Kit: emit kitUpdated signals on changes to devices/toolchains/qt

That is even if the id did not change, but the actual objects
for those ids changed.

Change-Id: Ib176f18cf66b11436d046bf08a81db27fce458f9
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent 22327b0f
......@@ -130,6 +130,8 @@ ToolChainKitInformation::ToolChainKitInformation()
this, SIGNAL(validationNeeded()));
connect(ToolChainManager::instance(), SIGNAL(toolChainUpdated(ProjectExplorer::ToolChain*)),
this, SIGNAL(validationNeeded()));
connect(ToolChainManager::instance(), SIGNAL(toolChainUpdated(ProjectExplorer::ToolChain*)),
this, SLOT(toolChainUpdated(ProjectExplorer::ToolChain*)));
}
Core::Id ToolChainKitInformation::dataId() const
......@@ -235,6 +237,13 @@ QString ToolChainKitInformation::msgNoToolChainInTarget()
return tr("No compiler set in kit.");
}
void ToolChainKitInformation::toolChainUpdated(ToolChain *tc)
{
foreach (Kit *k, KitManager::instance()->kits())
if (toolChain(k) == tc)
notifyAboutUpdate(k);
}
// --------------------------------------------------------------------------
// DeviceTypeInformation:
// --------------------------------------------------------------------------
......@@ -317,6 +326,8 @@ DeviceKitInformation::DeviceKitInformation()
this, SIGNAL(validationNeeded()));
connect(DeviceManager::instance(), SIGNAL(deviceUpdated(Core::Id)),
this, SIGNAL(validationNeeded()));
connect(DeviceManager::instance(), SIGNAL(deviceUpdated(Core::Id)),
this, SLOT(deviceUpdated(Core::Id)));
}
Core::Id DeviceKitInformation::dataId() const
......@@ -403,4 +414,11 @@ void DeviceKitInformation::setDeviceId(Kit *k, const Core::Id id)
k->setValue(Core::Id(DEVICE_INFORMATION), id.toString());
}
void DeviceKitInformation::deviceUpdated(const Core::Id &id)
{
foreach (Kit *k, KitManager::instance()->kits())
if (deviceId(k) == id)
notifyAboutUpdate(k);
}
} // namespace ProjectExplorer
......@@ -117,6 +117,8 @@ public:
static void setToolChain(Kit *k, ToolChain *tc);
static QString msgNoToolChainInTarget();
private slots:
void toolChainUpdated(ProjectExplorer::ToolChain *tc);
};
class PROJECTEXPLORER_EXPORT ToolChainMatcher : public KitMatcher
......@@ -207,6 +209,8 @@ public:
static Core::Id deviceId(const Kit *k);
static void setDevice(Kit *k, IDevice::ConstPtr dev);
static void setDeviceId(Kit *k, const Core::Id id);
private slots:
void deviceUpdated(const Core::Id &id);
};
class PROJECTEXPLORER_EXPORT DeviceMatcher : public KitMatcher
......
......@@ -459,4 +459,9 @@ QString KitInformation::displayNamePostfix(const Kit *k) const
return QString();
}
void KitInformation::notifyAboutUpdate(Kit *k)
{
KitManager::instance()->notifyAboutUpdate(k);
}
} // namespace ProjectExplorer
......@@ -85,6 +85,9 @@ public:
virtual QString displayNamePostfix(const Kit *k) const;
protected:
void notifyAboutUpdate(Kit *k);
signals:
void validationNeeded();
};
......@@ -165,6 +168,7 @@ private:
friend class ProjectExplorerPlugin; // for constructor
friend class Kit;
friend class Internal::KitModel;
friend class KitInformation; // for notifyAbutUpdate
};
} // namespace ProjectExplorer
......
......@@ -45,6 +45,8 @@ QtKitInformation::QtKitInformation()
setObjectName(QLatin1String("QtKitInformation"));
connect(QtVersionManager::instance(), SIGNAL(qtVersionsChanged(QList<int>,QList<int>,QList<int>)),
this, SIGNAL(validationNeeded()));
connect(QtVersionManager::instance(), SIGNAL(qtVersionsChanged(QList<int>,QList<int>,QList<int>)),
this, SLOT(qtVersionsChanged(QList<int>,QList<int>,QList<int>)));
}
Core::Id QtKitInformation::dataId() const
......@@ -166,6 +168,17 @@ void QtKitInformation::setQtVersion(ProjectExplorer::Kit *k, const BaseQtVersion
setQtVersionId(k, v->uniqueId());
}
void QtKitInformation::qtVersionsChanged(const QList<int> &addedIds,
const QList<int> &removedIds,
const QList<int> &changedIds)
{
Q_UNUSED(addedIds);
Q_UNUSED(removedIds);
foreach (ProjectExplorer::Kit *k, ProjectExplorer::KitManager::instance()->kits())
if (changedIds.contains(qtVersionId(k)))
notifyAboutUpdate(k);
}
QtPlatformKitMatcher::QtPlatformKitMatcher(const QString &platform) :
m_platform(platform)
{ }
......
......@@ -66,6 +66,10 @@ public:
static void setQtVersionId(ProjectExplorer::Kit *k, const int id);
static BaseQtVersion *qtVersion(const ProjectExplorer::Kit *k);
static void setQtVersion(ProjectExplorer::Kit *k, const BaseQtVersion *v);
private slots:
void qtVersionsChanged(const QList<int> &addedIds,
const QList<int> &removedIds,
const QList<int> &changedIds);
};
class QTSUPPORT_EXPORT QtPlatformKitMatcher : public ProjectExplorer::KitMatcher
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment