Commit acc35ab4 authored by Tobias Hunger's avatar Tobias Hunger
Browse files

MiniProjectTargetSelector: Update Kit area on Kit changes



Simplify the code a bit, and make it work while at it:-)

Change-Id: I4eb613ce526e148c18588443e5153d6e0118fa01
Reviewed-by: default avatarDaniel Teske <daniel.teske@theqtcompany.com>
parent 4f383f77
......@@ -549,6 +549,7 @@ KitAreaWidget::KitAreaWidget(QWidget *parent) : QWidget(parent),
m_layout(new QGridLayout(this)), m_kit(0)
{
m_layout->setMargin(3);
connect(KitManager::instance(), &KitManager::kitUpdated, this, &KitAreaWidget::updateKit);
}
KitAreaWidget::~KitAreaWidget()
......@@ -558,21 +559,17 @@ KitAreaWidget::~KitAreaWidget()
void KitAreaWidget::setKit(Kit *k)
{
if (k == m_kit)
return;
foreach (KitConfigWidget *w, m_widgets)
delete(w);
m_widgets.clear();
if (!k)
return;
foreach (QLabel *l, m_labels)
l->deleteLater();
m_labels.clear();
if (m_kit) {
disconnect(KitManager::instance(), SIGNAL(kitUpdated(ProjectExplorer::Kit*)),
this, SLOT(updateKit(ProjectExplorer::Kit*)));
}
int row = 0;
foreach (KitInformation *ki, KitManager::kitInformation()) {
if (k && k->isMutable(ki->id())) {
......@@ -588,11 +585,6 @@ void KitAreaWidget::setKit(Kit *k)
}
m_kit = k;
if (m_kit) {
connect(KitManager::instance(), SIGNAL(kitUpdated(ProjectExplorer::Kit*)),
this, SLOT(updateKit(ProjectExplorer::Kit*)));
}
setHidden(m_widgets.isEmpty());
}
......
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