Commit 0f215152 authored by Erik Verbruggen's avatar Erik Verbruggen

Fix: do not put in duplicate definitions.

Change-Id: Ia3f248d013a1b4f98ad3e85d13cfcf214d3c97c7
Reviewed-by: default avatarEike Ziller <eike.ziller@nokia.com>
parent c1596926
......@@ -812,12 +812,21 @@ QStringList CppModelManager::internalFrameworkPaths() const
QByteArray CppModelManager::internalDefinedMacros() const
{
QByteArray macros;
QSet<QByteArray> alreadyIn;
QMapIterator<ProjectExplorer::Project *, ProjectInfo> it(m_projects);
while (it.hasNext()) {
it.next();
ProjectInfo pinfo = it.value();
foreach (const ProjectPart::Ptr &part, pinfo.projectParts())
macros += part->defines;
foreach (const ProjectPart::Ptr &part, pinfo.projectParts()) {
const QList<QByteArray> defs = part->defines.split('\n');
foreach (const QByteArray &def, defs) {
if (!alreadyIn.contains(def)) {
macros += def;
macros.append('\n');
alreadyIn.insert(def);
}
}
}
}
return macros;
}
......
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