forked from qt-creator/qt-creator
QmnlDesigner: Avoid paths starting with '//'
Windows these are interpreted as network hosts and the timeout when resolving those is way too long. Task-number: QTCREATORBUG-21372 Change-Id: Ib796473158cec620de26592bf628ab18d676153d Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
committed by
Tim Jenssen
parent
81f019f033
commit
4f7d24acb6
@@ -554,21 +554,25 @@ QString PropertyEditorQmlBackend::locateQmlFile(const NodeMetaInfo &info, const
|
|||||||
|
|
||||||
const QString withoutDirWithVersion = relativePathWithVersion.split(QStringLiteral("/")).constLast();
|
const QString withoutDirWithVersion = relativePathWithVersion.split(QStringLiteral("/")).constLast();
|
||||||
|
|
||||||
const QStringList possiblePaths = {
|
QStringList possiblePaths = {
|
||||||
importDir.absoluteFilePath(relativePathWithVersion),
|
|
||||||
//Since we are in a subfolder of the import we do not require the directory
|
|
||||||
importDir.absoluteFilePath(withoutDirWithVersion),
|
|
||||||
fileSystemDir.absoluteFilePath(relativePathWithVersion),
|
fileSystemDir.absoluteFilePath(relativePathWithVersion),
|
||||||
resourcesDir.absoluteFilePath(relativePathWithVersion),
|
resourcesDir.absoluteFilePath(relativePathWithVersion),
|
||||||
|
|
||||||
importDir.absoluteFilePath(relativePath),
|
|
||||||
//Since we are in a subfolder of the import we do not require the directory
|
|
||||||
importDir.absoluteFilePath(withoutDir),
|
|
||||||
fileSystemDir.absoluteFilePath(relativePath),
|
fileSystemDir.absoluteFilePath(relativePath),
|
||||||
resourcesDir.absoluteFilePath(relativePath)
|
resourcesDir.absoluteFilePath(relativePath)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (!importDir.isEmpty())
|
||||||
|
possiblePaths.append({
|
||||||
|
importDir.absoluteFilePath(relativePathWithVersion),
|
||||||
|
//Since we are in a subfolder of the import we do not require the directory
|
||||||
|
importDir.absoluteFilePath(withoutDirWithVersion),
|
||||||
|
importDir.absoluteFilePath(relativePath),
|
||||||
|
//Since we are in a subfolder of the import we do not require the directory
|
||||||
|
importDir.absoluteFilePath(withoutDir),
|
||||||
|
});
|
||||||
|
|
||||||
return Utils::findOrDefault(possiblePaths, [](const QString &possibleFilePath) {
|
return Utils::findOrDefault(possiblePaths, [](const QString &possibleFilePath) {
|
||||||
return QFile::exists(possibleFilePath);
|
return QFileInfo::exists(possibleFilePath);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user