diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2016-08-29 11:27:49 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2016-08-29 10:04:58 +0000 |
commit | 95eea53e12ac964efe72e9145b7d822d239d4ef1 (patch) | |
tree | ebc803a6d2db92efea2b4df24553cfc1e9a426a9 | |
parent | 8d975bc9273d58d54b6bf461078c481af1b201dd (diff) |
ModuleLoader: Remove redundant data type
Change-Id: I5241e5363a26938f52cc4e9cd2d2c6a8d8fb965a
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
-rw-r--r-- | src/lib/corelib/language/moduleloader.cpp | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/src/lib/corelib/language/moduleloader.cpp b/src/lib/corelib/language/moduleloader.cpp index 274f68a5b..a7cd3f310 100644 --- a/src/lib/corelib/language/moduleloader.cpp +++ b/src/lib/corelib/language/moduleloader.cpp @@ -494,8 +494,7 @@ void ModuleLoader::handleProject(ModuleLoaderResult *loadResult, const QString projectFileDirPath = FileInfo::path(projectItem->file()->filePath()); const QStringList refs = m_evaluator->stringListValue(projectItem, QLatin1String("references")); - typedef QPair<Item *, QString> ItemAndRefPath; - QList<ItemAndRefPath> additionalProjectChildren; + QList<Item *> additionalProjectChildren; foreach (const QString &filePath, refs) { QString absReferencePath = FileInfo::resolvePath(projectFileDirPath, filePath); if (FileInfo(absReferencePath).isDir()) { @@ -522,16 +521,11 @@ void ModuleLoader::handleProject(ModuleLoaderResult *loadResult, Item *subItem = m_reader->readFile(absReferencePath); subItem->setScope(projectContext.scope); subItem->setParent(projectContext.item); - additionalProjectChildren << qMakePair(subItem, absReferencePath); - if (subItem->type() == ItemType::Product) { - foreach (Item * const additionalProductItem, - multiplexProductItem(&dummyProductContext, subItem)) { - additionalProjectChildren << qMakePair(additionalProductItem, absReferencePath); - } - } + additionalProjectChildren << subItem; + if (subItem->type() == ItemType::Product) + additionalProjectChildren << multiplexProductItem(&dummyProductContext, subItem); } - foreach (const ItemAndRefPath &irp, additionalProjectChildren) { - Item * const subItem = irp.first; + foreach (Item * const subItem, additionalProjectChildren) { Item::addChild(projectContext.item, subItem); switch (subItem->type()) { case ItemType::Product: @@ -540,7 +534,7 @@ void ModuleLoader::handleProject(ModuleLoaderResult *loadResult, case ItemType::Project: copyProperties(projectItem, subItem); handleProject(loadResult, topLevelProjectContext, subItem, - QSet<QString>(referencedFilePaths) << irp.second); + QSet<QString>(referencedFilePaths) << subItem->file()->filePath()); break; default: throw ErrorInfo(Tr::tr("The top-level item of a file in a \"references\" list must be " |