summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/cppsourceprocessor.cpp
diff options
context:
space:
mode:
authorFinn Brudal <Finn.Brudal@kongsberg.com>2016-05-31 10:35:56 +0200
committerFinn Brudal <Finn.Brudal@kongsberg.com>2016-06-22 07:52:58 +0000
commit23cd42557dc305dfc72fdf2070dd85956e154444 (patch)
treedc94da4546489d5b38c8c73bd85a49bdb1290961 /src/plugins/cpptools/cppsourceprocessor.cpp
parent943cb2b3781d70bcd4dc7044cd983d8077021b51 (diff)
downloadqt-creator-23cd42557dc305dfc72fdf2070dd85956e154444.tar.gz
CppTools: Fix include/framework search order
Task-number: QTCREATORBUG-11599 Change-Id: Ie0bd25e0d6376b5e2c0e251e64aad8dfb773e76e Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Diffstat (limited to 'src/plugins/cpptools/cppsourceprocessor.cpp')
-rw-r--r--src/plugins/cpptools/cppsourceprocessor.cpp30
1 files changed, 12 insertions, 18 deletions
diff --git a/src/plugins/cpptools/cppsourceprocessor.cpp b/src/plugins/cpptools/cppsourceprocessor.cpp
index ac6ccd0950..f238a841f7 100644
--- a/src/plugins/cpptools/cppsourceprocessor.cpp
+++ b/src/plugins/cpptools/cppsourceprocessor.cpp
@@ -291,25 +291,19 @@ QString CppSourceProcessor::resolveFile_helper(const QString &fileName,
ProjectPartHeaderPaths::Iterator headerPathsIt)
{
auto headerPathsEnd = m_headerPaths.end();
- for (; headerPathsIt != headerPathsEnd; ++headerPathsIt) {
- if (headerPathsIt->isFrameworkPath())
- continue;
- const QString path = headerPathsIt->path + fileName;
- if (m_workingCopy.contains(path) || checkFile(path))
- return path;
- }
-
const int index = fileName.indexOf(QLatin1Char('/'));
- if (index != -1) {
- const QString frameworkName = fileName.left(index);
- const QString name = frameworkName + QLatin1String(".framework/Headers/")
- + fileName.mid(index + 1);
-
- foreach (const ProjectPartHeaderPath &headerPath, m_headerPaths) {
- if (!headerPath.isFrameworkPath())
- continue;
- const QString path = headerPath.path + name;
- if (checkFile(path))
+ for (; headerPathsIt != headerPathsEnd; ++headerPathsIt) {
+ if (headerPathsIt->isValid()) {
+ QString path;
+ if (headerPathsIt->isFrameworkPath()) {
+ if (index == -1)
+ continue;
+ path = headerPathsIt->path + fileName.left(index)
+ + QLatin1String(".framework/Headers/") + fileName.mid(index + 1);
+ } else {
+ path = headerPathsIt->path + fileName;
+ }
+ if (m_workingCopy.contains(path) || checkFile(path))
return path;
}
}