summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/cppsourceprocessor.cpp
diff options
context:
space:
mode:
authorNikolai Kosjar <nikolai.kosjar@theqtcompany.com>2016-02-16 16:01:26 +0100
committerNikolai Kosjar <nikolai.kosjar@theqtcompany.com>2016-02-26 12:00:36 +0000
commit47950597033c24ae4d784e63c7204b7e36ab6443 (patch)
tree29d3953b776d5a1eda71761e92d1b65f602421ee /src/plugins/cpptools/cppsourceprocessor.cpp
parentd36716ae1499ce2e23ad71015bce7653b4aa17e2 (diff)
downloadqt-creator-47950597033c24ae4d784e63c7204b7e36ab6443.tar.gz
CppTools: Avoid inserting invalid entries into cache
...of resolved files. This is an issue when first a misconfigured project (missing include paths) is indexed. E.g. then <QtTest> resolves to "", which is inserted into the cache. Resolving the same header for subsequent projects has returned the empty string although their header paths were correct. This led to wrong includes of documents from the global snapshot. Task-number: QTCREATORBUG-15736 Change-Id: Ia3e3a06775a50dd75bc62a46d674c7b46a1c5965 Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
Diffstat (limited to 'src/plugins/cpptools/cppsourceprocessor.cpp')
-rw-r--r--src/plugins/cpptools/cppsourceprocessor.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/cpptools/cppsourceprocessor.cpp b/src/plugins/cpptools/cppsourceprocessor.cpp
index c5376b9b96..390380e677 100644
--- a/src/plugins/cpptools/cppsourceprocessor.cpp
+++ b/src/plugins/cpptools/cppsourceprocessor.cpp
@@ -245,7 +245,8 @@ QString CppSourceProcessor::resolveFile(const QString &fileName, IncludeType typ
if (it != m_fileNameCache.constEnd())
return it.value();
const QString fn = resolveFile_helper(fileName, type);
- m_fileNameCache.insert(fileName, fn);
+ if (!fn.isEmpty())
+ m_fileNameCache.insert(fileName, fn);
return fn;
}