summaryrefslogtreecommitdiff
path: root/src/widgets/dialogs/qfiledialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/dialogs/qfiledialog.cpp')
-rw-r--r--src/widgets/dialogs/qfiledialog.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp
index 4cda5f34ad..3d91bdef34 100644
--- a/src/widgets/dialogs/qfiledialog.cpp
+++ b/src/widgets/dialogs/qfiledialog.cpp
@@ -2830,7 +2830,10 @@ void QFileDialogPrivate::init(const QUrl &directory, const QString &nameFilter,
if (!nameFilter.isEmpty())
q->setNameFilter(nameFilter);
q->setDirectoryUrl(workingDirectory(directory));
- q->selectFile(initialSelection(directory));
+ if (directory.isLocalFile())
+ q->selectFile(initialSelection(directory));
+ else
+ q->selectUrl(directory);
#ifndef QT_NO_SETTINGS
// Try to restore from the FileDialog settings group; if it fails, fall back