Commit 47950597 authored by Nikolai Kosjar's avatar Nikolai Kosjar

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: default avatarChristian Stenger <christian.stenger@theqtcompany.com>
Reviewed-by: default avatarErik Verbruggen <erik.verbruggen@theqtcompany.com>
parent d36716ae
......@@ -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;
}
......
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