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 <daniel.teske@digia.com>
This commit is contained in:
Fawzi Mohamed
2013-12-09 15:40:23 +01:00
parent c1a71b1cfa
commit 9f96d7d01d
2 changed files with 22 additions and 1 deletions

View File

@@ -48,6 +48,17 @@ public:
QString additionalArguments; QString additionalArguments;
QString makefile; 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<ProjectExplorer::Task> reportIssues(const QString &projectPath, QList<ProjectExplorer::Task> reportIssues(const QString &projectPath,
const QString &buildDir) const const QString &buildDir) const
{ {

View File

@@ -163,6 +163,16 @@ QList<ProjectExplorer::BuildInfo *> QmakeProjectImporter::import(const Utils::Fi
info->additionalArguments = additionalArguments; info->additionalArguments = additionalArguments;
info->makefile = makefile; info->makefile = makefile;
bool found = false;
foreach (ProjectExplorer::BuildInfo *bInfo, result) {
if (*static_cast<QmakeBuildInfo *>(bInfo) == *info) {
found = true;
break;
}
}
if (found)
delete info;
else
result << info; result << info;
} }
} }