QmlPreview: workaround for not starting preview

In the case of absolute path, do not try wrongly calculated
candidates in case of a parent dir and a sub dir having the
same name.
A directory with UntitledProject68/UntitledProject68/Screen01.qml,
asking for parent UntitledProject68 listed the subdirectory content instead of the parent directory.

Task-number: QDS-13292
Change-Id: I6edb61957200b10f9465ad2eaeefeee533ac2375
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Tim Jenssen
2024-10-30 13:16:55 +01:00
parent d2b1b1fd46
commit 84077e78ee

View File

@@ -191,6 +191,11 @@ bool FileInProjectFinder::findFileOrDirectory(const FilePath &originalPath, File
directoryHandler(node->children.keys(), origLength);
qCDebug(finderLog) << "FileInProjectFinder: found virtual directory" << originalPath
<< "in mapped paths";
}
}
if (originalPath == m_projectDir) {
if (checkPath(originalPath, originalPath.toFSPathString().length(), fileHandler, directoryHandler)) {
return true;
}
}