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 <hjk@qt.io>
This commit is contained in:
Marcus Tillmanns
2022-10-14 09:48:23 +02:00
parent e328c90f4c
commit e83a6bacb6

View File

@@ -199,6 +199,9 @@ FilePath PathChooserPrivate::expandedPath(const FilePath &input) const
if (path.isEmpty()) if (path.isEmpty())
return path; return path;
if (path.isAbsolutePath())
return path;
switch (m_acceptingKind) { switch (m_acceptingKind) {
case PathChooser::Command: case PathChooser::Command:
case PathChooser::ExistingCommand: { case PathChooser::ExistingCommand: {
@@ -391,7 +394,7 @@ void PathChooser::slotBrowse()
case PathChooser::ExistingDirectory: case PathChooser::ExistingDirectory:
newPath = FileUtils::getExistingDirectory(this, newPath = FileUtils::getExistingDirectory(this,
makeDialogTitle(tr("Choose Directory")), makeDialogTitle(tr("Choose Directory")),
predefined); predefined, {}, d->m_allowPathFromDevice);
break; break;
case PathChooser::ExistingCommand: case PathChooser::ExistingCommand:
case PathChooser::Command: case PathChooser::Command: