forked from qt-creator/qt-creator
Debugger: Prefer files in current project over files in sysroot
Only use file in sysroot as ultimate fallback. Change-Id: I3dd3b87228c87387f994792f74634add03845ad7 Reviewed-by: Aurindam Jana <aurindam.jana@nokia.com>
This commit is contained in:
@@ -190,6 +190,17 @@ QString FileInProjectFinder::findFile(const QUrl &fileUrl, bool *success) const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// find (solely by filename) in project files
|
||||||
|
const QString fileName = QFileInfo(originalPath).fileName();
|
||||||
|
foreach (const QString &f, m_projectFiles) {
|
||||||
|
if (QFileInfo(f).fileName() == fileName) {
|
||||||
|
m_cache.insert(originalPath, f);
|
||||||
|
if (success)
|
||||||
|
*success = true;
|
||||||
|
return f;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// check if absolute path is found in sysroot
|
// check if absolute path is found in sysroot
|
||||||
if (!m_sysroot.isEmpty()) {
|
if (!m_sysroot.isEmpty()) {
|
||||||
const QString sysrootPath = m_sysroot + originalPath;
|
const QString sysrootPath = m_sysroot + originalPath;
|
||||||
@@ -201,17 +212,6 @@ QString FileInProjectFinder::findFile(const QUrl &fileUrl, bool *success) const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// finally, find solely by filename in project files
|
|
||||||
const QString fileName = QFileInfo(originalPath).fileName();
|
|
||||||
foreach (const QString &f, m_projectFiles) {
|
|
||||||
if (QFileInfo(f).fileName() == fileName) {
|
|
||||||
m_cache.insert(originalPath, f);
|
|
||||||
if (success)
|
|
||||||
*success = true;
|
|
||||||
return f;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (success)
|
if (success)
|
||||||
*success = false;
|
*success = false;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user