forked from qt-creator/qt-creator
FileInProjectFinder: Use the cache also without project directory
As we add things to the cache, also without a project directory, there is no reason why we wouldn't use the cache when looking them up. Change-Id: I9f90cf7b88410513d2ebd0524e7d369fcb4db704 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -159,10 +159,6 @@ QString FileInProjectFinder::findFileOrDirectory(const QString &originalPath, Fi
|
|||||||
return originalPath;
|
return originalPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!m_projectDir.isEmpty()) {
|
|
||||||
if (debug)
|
|
||||||
qDebug() << "FileInProjectFinder: checking project directory ...";
|
|
||||||
|
|
||||||
auto it = m_cache.find(originalPath);
|
auto it = m_cache.find(originalPath);
|
||||||
if (it != m_cache.end()) {
|
if (it != m_cache.end()) {
|
||||||
if (debug)
|
if (debug)
|
||||||
@@ -175,6 +171,10 @@ QString FileInProjectFinder::findFileOrDirectory(const QString &originalPath, Fi
|
|||||||
m_cache.erase(it);
|
m_cache.erase(it);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!m_projectDir.isEmpty()) {
|
||||||
|
if (debug)
|
||||||
|
qDebug() << "FileInProjectFinder: checking project directory ...";
|
||||||
|
|
||||||
int prefixToIgnore = -1;
|
int prefixToIgnore = -1;
|
||||||
const QChar separator = QLatin1Char('/');
|
const QChar separator = QLatin1Char('/');
|
||||||
if (originalPath.startsWith(m_projectDir + separator)) {
|
if (originalPath.startsWith(m_projectDir + separator)) {
|
||||||
|
Reference in New Issue
Block a user