forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user