forked from qt-creator/qt-creator
Toolchainsoptions page: Treat adding/removing correctly
Reviewed-By: hunger
This commit is contained in:
@@ -307,7 +307,6 @@ void ToolChainModel::apply()
|
|||||||
foreach (ToolChainNode *n, nodes) {
|
foreach (ToolChainNode *n, nodes) {
|
||||||
ToolChainManager::instance()->registerToolChain(n->toolChain);
|
ToolChainManager::instance()->registerToolChain(n->toolChain);
|
||||||
}
|
}
|
||||||
Q_ASSERT(m_toAddList.isEmpty());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ToolChainModel::discard()
|
void ToolChainModel::discard()
|
||||||
@@ -339,6 +338,7 @@ void ToolChainModel::discard()
|
|||||||
n->widget->discard();
|
n->widget->discard();
|
||||||
n->changed = false;
|
n->changed = false;
|
||||||
}
|
}
|
||||||
|
reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ToolChainModel::markForRemoval(ToolChain *tc)
|
void ToolChainModel::markForRemoval(ToolChain *tc)
|
||||||
@@ -351,9 +351,15 @@ void ToolChainModel::markForRemoval(ToolChain *tc)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (node) {
|
if (node) {
|
||||||
m_toRemoveList.append(node);
|
|
||||||
emit beginRemoveRows(index(m_manualRoot), m_manualRoot->childNodes.indexOf(node), m_manualRoot->childNodes.indexOf(node));
|
emit beginRemoveRows(index(m_manualRoot), m_manualRoot->childNodes.indexOf(node), m_manualRoot->childNodes.indexOf(node));
|
||||||
m_manualRoot->childNodes.removeOne(node);
|
m_manualRoot->childNodes.removeOne(node);
|
||||||
|
if (m_toAddList.contains(node)) {
|
||||||
|
delete node->toolChain;
|
||||||
|
node->toolChain = 0;
|
||||||
|
m_toAddList.removeOne(node);
|
||||||
|
} else {
|
||||||
|
m_toRemoveList.append(node);
|
||||||
|
}
|
||||||
emit endRemoveRows();
|
emit endRemoveRows();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user