From 9f96d7d01d04132e304decbb310a03f13684604e Mon Sep 17 00:00:00 2001 From: Fawzi Mohamed Date: Mon, 9 Dec 2013 15:40:23 +0100 Subject: [PATCH] qmakeprojectimporter: avoid adding duplicate entries ios having multiple makefiles gets detected several times and one ends up with 5 times the same entry when conviguring a project that was already present Change-Id: I5685208305d1f489c5502d5aec0c08dded49da90 Reviewed-by: Daniel Teske --- src/plugins/qmakeprojectmanager/qmakebuildinfo.h | 11 +++++++++++ .../qmakeprojectmanager/qmakeprojectimporter.cpp | 12 +++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/plugins/qmakeprojectmanager/qmakebuildinfo.h b/src/plugins/qmakeprojectmanager/qmakebuildinfo.h index 41d2922e6e7..59e71c56edd 100644 --- a/src/plugins/qmakeprojectmanager/qmakebuildinfo.h +++ b/src/plugins/qmakeprojectmanager/qmakebuildinfo.h @@ -48,6 +48,17 @@ public: QString additionalArguments; QString makefile; + bool operator==(const QmakeBuildInfo &o) { + return displayName == o.displayName + && typeName == o.typeName + && buildDirectory == o.buildDirectory + && kitId == o.kitId + && typeName == o.typeName + && supportsShadowBuild == o.supportsShadowBuild + && type == o.type + && additionalArguments == o.additionalArguments; + } + QList reportIssues(const QString &projectPath, const QString &buildDir) const { diff --git a/src/plugins/qmakeprojectmanager/qmakeprojectimporter.cpp b/src/plugins/qmakeprojectmanager/qmakeprojectimporter.cpp index 1a2395b5ef9..2ec868ba11e 100644 --- a/src/plugins/qmakeprojectmanager/qmakeprojectimporter.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeprojectimporter.cpp @@ -163,7 +163,17 @@ QList QmakeProjectImporter::import(const Utils::Fi info->additionalArguments = additionalArguments; info->makefile = makefile; - result << info; + bool found = false; + foreach (ProjectExplorer::BuildInfo *bInfo, result) { + if (*static_cast(bInfo) == *info) { + found = true; + break; + } + } + if (found) + delete info; + else + result << info; } }