Commit 4bc1b19d authored by Tobias Hunger's avatar Tobias Hunger
Browse files

Warn when ignoring tool chain addition

Warn when ignoring a tool chain addition because a identical
is already configured.

Task-number: QTCREATORBUG-4206
parent 96de9705
......@@ -207,17 +207,18 @@ ToolChain *ToolChainManager::findToolChain(const QString &id) const
return 0;
void ToolChainManager::registerToolChain(ToolChain *tc)
bool ToolChainManager::registerToolChain(ToolChain *tc)
if (!tc || m_d->m_toolChains.contains(tc))
return true;
foreach (ToolChain *current, m_d->m_toolChains) {
if (*tc == *current)
return false;
emit toolChainAdded(tc);
return true;
void ToolChainManager::deregisterToolChain(ToolChain *tc)
......@@ -69,7 +69,7 @@ public:
ToolChain *findToolChain(const QString &id) const;
public slots:
void registerToolChain(ProjectExplorer::ToolChain *tc);
bool registerToolChain(ProjectExplorer::ToolChain *tc);
void deregisterToolChain(ProjectExplorer::ToolChain *tc);
void saveToolChains();
......@@ -306,15 +306,34 @@ void ToolChainModel::apply()
// Add new (and already updated) tool chains
QStringList removedTcs;
nodes = m_toAddList;
foreach (ToolChainNode *n, nodes) {
if (!ToolChainManager::instance()->registerToolChain(n->toolChain))
removedTcs << n->toolChain->displayName();
foreach (ToolChainNode *n, m_toAddList) {
if (removedTcs.count() == 1) {
tr("Duplicate Tool Chain detected"),
tr("The following tool chain was already configured:<br>"
"It was not configured again.")
} else if (!removedTcs.isEmpty()) {
tr("Duplicate Tool Chains detected"),
tr("The following tool chains were already configured:<br>"
"They were not configured again.")
void ToolChainModel::markForRemoval(ToolChain *tc)
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