From e83a6bacb67557c8e2a5c315d7aadea185ba8f06 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns Date: Fri, 14 Oct 2022 09:48:23 +0200 Subject: [PATCH] Utils: Fix pathchooser for remote directories PathChooserPrivate::expandedPath has a hack that interferes with remote paths when they are already absolute. This patch short-circuits it to keep absolute remote paths intact. Change-Id: I6438842a693653404aa07160de9f68bdbf22519b Reviewed-by: hjk --- src/libs/utils/pathchooser.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/libs/utils/pathchooser.cpp b/src/libs/utils/pathchooser.cpp index 3d7ac909740..ef30703c9b7 100644 --- a/src/libs/utils/pathchooser.cpp +++ b/src/libs/utils/pathchooser.cpp @@ -199,6 +199,9 @@ FilePath PathChooserPrivate::expandedPath(const FilePath &input) const if (path.isEmpty()) return path; + if (path.isAbsolutePath()) + return path; + switch (m_acceptingKind) { case PathChooser::Command: case PathChooser::ExistingCommand: { @@ -391,7 +394,7 @@ void PathChooser::slotBrowse() case PathChooser::ExistingDirectory: newPath = FileUtils::getExistingDirectory(this, makeDialogTitle(tr("Choose Directory")), - predefined); + predefined, {}, d->m_allowPathFromDevice); break; case PathChooser::ExistingCommand: case PathChooser::Command: