diff options
author | Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com> | 2015-01-29 13:27:04 +0100 |
---|---|---|
committer | Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com> | 2015-02-15 11:13:47 +0000 |
commit | 48344390525ea25ffb1cdf363eb596e2ac6c795e (patch) | |
tree | f278b31a08249e3e8d95df4035aa11a76f5b663d /src/widgets | |
parent | f9bb92df24e3ed7dee453c59edaa4278193e6e6a (diff) |
QFileDialog: don't clear directory url upon show
If the app sets a directory url that is not a local
file, the url would be cleared just before showing the
dialog. The reason is that we try to convert the url
to a local file when preparing helper options, but fail.
Trying to convert the url in the first place is wrong, since
the app should be able to point the file dialog to any url, not
just local directories.
Since QFileDialogPrivate::init() calls
QFileDialog::setDirectoryUrl(), and setDirectoryUrl() calls
options->setInitialDirectory(), there should be no reason
to set initialDirectory once more in
QFileDialogPrivate::helperPrepareShow(). The easiest fix
is therefore to remove the code in initHelper() that modifies
the initial url.
Change-Id: Ia6c2113e867b1156cf9d59d347116f7df8c06d93
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Diffstat (limited to 'src/widgets')
-rw-r--r-- | src/widgets/dialogs/qfiledialog.cpp | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp index 4616933bcf..0f368f4910 100644 --- a/src/widgets/dialogs/qfiledialog.cpp +++ b/src/widgets/dialogs/qfiledialog.cpp @@ -586,10 +586,6 @@ void QFileDialogPrivate::helperPrepareShow(QPlatformDialogHelper *) options->setHistory(q->history()); if (usingWidgets()) options->setSidebarUrls(qFileDialogUi->sidebar->urls()); - const QDir directory = q->directory(); - options->setInitialDirectory(directory.exists() ? - QUrl::fromLocalFile(directory.absolutePath()) : - QUrl()); if (options->initiallySelectedNameFilter().isEmpty()) options->setInitiallySelectedNameFilter(q->selectedNameFilter()); if (options->initiallySelectedFiles().isEmpty()) |