Commit accf6d0e authored by Kai Koehne's avatar Kai Koehne
Browse files

Debugger: Prefer files in current project over files in sysroot



Only use file in sysroot as ultimate fallback.

Change-Id: I3dd3b87228c87387f994792f74634add03845ad7
Reviewed-by: default avatarAurindam Jana <aurindam.jana@nokia.com>
parent 1dfe884c
......@@ -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
if (!m_sysroot.isEmpty()) {
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)
*success = false;
......
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