QMake: fix gui thread lock

Do not look up windows network paths in profile editor when looking for
links under the cursor. The QFileInfo::exists check can take up to a
minute here if this network path does not exists.

Fixes: QTCREATORBUG-26579
Change-Id: I2648bc398e25bcc660f1161a187c4d92c3def28e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
David Schulz
2021-11-16 11:43:55 +01:00
parent db1d3f3c94
commit e68e2a3159

View File

@@ -229,7 +229,10 @@ void ProFileEditorWidget::findLinkAt(const QTextCursor &cursor,
QDir dir(textDocument()->filePath().toFileInfo().absolutePath());
QString fileName = dir.filePath(buffer);
QFileInfo fi(fileName);
if (fi.exists()) {
if (Utils::HostOsInfo::isWindowsHost() && fileName.startsWith("//")) {
// Windows network paths are not supported here since checking for their existence can
// lock the gui thread. See: QTCREATORBUG-26579
} else if (fi.exists()) {
if (fi.isDir()) {
QDir subDir(fi.absoluteFilePath());
QString subProject = subDir.filePath(subDir.dirName() + QLatin1String(".pro"));