summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2019-04-25 18:14:38 +0200
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2019-05-22 16:23:45 +0200
commit5cd08cc0ab269556ff794ecc0de73d72b852c75a (patch)
tree7f357ebb44e1adcac31ad670087e5af3c32567ff /vcl
parent97ecb2af57c5aa469d9d5dff5a488d96220269dc (diff)
tdf#123750 kde5: Show removable devices in file dialog
As the Qt documentation for 'QFileDialog::supportedSchemes' says, setting supported schemes to a non-empty list restricts the available options: "Setting this property allows to restrict the type of URLs the user will be able to select. It is a way for the application to declare the protocols it will support to fetch the file content. An empty list means that no restriction is applied (the default)." The call to 'QFileDialog::setSupportedSchemes' was copied over from the gtk3_kde5 VCL plugin in commit 6196b7292fbb3168c558e64881601148c15653e4, where it had been added by commit f1b60bd62daff4aaf6465caadd4ad0c447521102 "Support opening of (some) remote URLs through the KDE file dialog". Since only either all schemes (if nothing explicitly set) or a whitelist of supported locations seems to be possible (s.a. the Phabricator changes referenced in the commit message of commit f1b60bd62daff4aaf6465caadd4ad0c447521102), add the "" scheme that makes removable devices shown -- while there doesn't seem to be an official documentation on the available schemes, at least not in KFileWidget's API documentation [1]. A quick test with all new available options after removing the call to 'QFileDialog::setSupportedSchemes' altogether indicated that opening and saving files there doesn't work reliably in all cases, so rather excplicitly add the "" scheme rather than claiming support for all schemes (including e.g. "timeline", "search", "remote", "trash"). [1] https://api.kde.org/frameworks/kio/html/classKFileWidget.html Change-Id: I89dc37d0f06d280e5dd599f90768c13e8edb915b Reviewed-on: https://gerrit.libreoffice.org/71320 Tested-by: Jenkins Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de> (cherry picked from commit 2c69c93fdb871809825fe8b9aff40b7afb093be8) Reviewed-on: https://gerrit.libreoffice.org/72750 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/unx/kde5/KDE5FilePicker2.cxx9
1 files changed, 3 insertions, 6 deletions
diff --git a/vcl/unx/kde5/KDE5FilePicker2.cxx b/vcl/unx/kde5/KDE5FilePicker2.cxx
index 6bdc63de926a..ae8149aabfdf 100644
--- a/vcl/unx/kde5/KDE5FilePicker2.cxx
+++ b/vcl/unx/kde5/KDE5FilePicker2.cxx
@@ -98,13 +98,10 @@ KDE5FilePicker::KDE5FilePicker(QFileDialog::FileMode eMode)
setCustomControlWidgetLayout(_layout);
m_pFileDialog->setSupportedSchemes({
- QStringLiteral("file"),
- QStringLiteral("ftp"),
- QStringLiteral("http"),
- QStringLiteral("https"),
- QStringLiteral("webdav"),
- QStringLiteral("webdavs"),
+ QStringLiteral("file"), QStringLiteral("ftp"), QStringLiteral("http"),
+ QStringLiteral("https"), QStringLiteral("webdav"), QStringLiteral("webdavs"),
QStringLiteral("smb"),
+ QStringLiteral(""), // this makes removable devices shown
});
// used to set the custom controls