forked from qt-creator/qt-creator
FileInProjectFinder: Fix path analysis
The previous code let to all possible paths to be accepted with maximum confidence. Fixes: QTCREATORBUG-29090 Change-Id: I3e0876d2fd1a5636dbe45cf152c8a251316185ff Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
@@ -248,7 +248,10 @@ bool FileInProjectFinder::findFileOrDirectory(const FilePath &originalPath, File
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
while (prefixToIgnore != -1) {
|
while (prefixToIgnore != -1) {
|
||||||
FilePath candidate = originalPath.resolvePath(m_projectDir);
|
QString candidateString = originalPath.toFSPathString();
|
||||||
|
candidateString.remove(0, prefixToIgnore);
|
||||||
|
candidateString.prepend(m_projectDir.toString());
|
||||||
|
const FilePath candidate = FilePath::fromString(candidateString);
|
||||||
const int matchLength = origLength - prefixToIgnore;
|
const int matchLength = origLength - prefixToIgnore;
|
||||||
// FIXME: This might be a worse match than what we find later.
|
// FIXME: This might be a worse match than what we find later.
|
||||||
if (checkPath(candidate, matchLength, fileHandler, directoryHandler)) {
|
if (checkPath(candidate, matchLength, fileHandler, directoryHandler)) {
|
||||||
|
Reference in New Issue
Block a user