From bf4b6d6fc39a758747fda055d85e5def68267357 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Tue, 26 Jun 2012 12:56:20 +0200 Subject: [PATCH] Profile: Use tool chain to make profile name unique Task-number: QTCREATORBUG-7560 Change-Id: I194ab0084f57c266e1a712ec31873a826a61ae4a Reviewed-by: Daniel Teske Reviewed-by: Orgad Shaneh --- src/plugins/projectexplorer/profilemanager.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/plugins/projectexplorer/profilemanager.cpp b/src/plugins/projectexplorer/profilemanager.cpp index 3cf294b592d..af9f4cef72c 100644 --- a/src/plugins/projectexplorer/profilemanager.cpp +++ b/src/plugins/projectexplorer/profilemanager.cpp @@ -34,6 +34,7 @@ #include "profile.h" #include "profileconfigwidget.h" +#include "profileinformation.h" #include "profilemanagerconfigwidget.h" #include "project.h" @@ -397,7 +398,17 @@ bool ProfileManager::registerProfile(ProjectExplorer::Profile *p) QStringList names; foreach (Profile *tmp, profiles()) names << tmp->displayName(); - p->setDisplayName(Project::makeUnique(p->displayName(), names)); + QString name = p->displayName(); + QString uniqueName = Project::makeUnique(name, names); + if (uniqueName != name) { + ToolChain *tc = ToolChainProfileInformation::toolChain(p); + if (tc) { + const QString tcPostfix = QString::fromLatin1("-%1").arg(tc->displayName()); + if (!name.contains(tcPostfix)) + uniqueName = Project::makeUnique(name + tcPostfix, names); + } + } + p->setDisplayName(uniqueName); // make sure we have all the information in our profiles: foreach (ProfileInformation *pi, d->m_informationList) {