[Libreoffice-commits] core.git: Branch 'distro/lhm/libreoffice-6-1+backports' - vcl/unx
Michael Weghorn (via logerrit)
logerrit at kemper.freedesktop.org
Thu Apr 25 05:33:19 UTC 2019
vcl/unx/gtk3_kde5/kde5_filepicker.cxx | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
New commits:
commit af5ce330371abdc0c7d5a4ac998cb17c78d2b7d1
Author: Michael Weghorn <m.weghorn at posteo.de>
AuthorDate: Wed Apr 24 11:31:06 2019 +0200
Commit: Michael Weghorn <m.weghorn at posteo.de>
CommitDate: Thu Apr 25 07:32:47 2019 +0200
gtk3_kde5: Make folder selection more intuitive
When 'QFileDialog::Directory' is set, the native
Plasma QFileDialog does not consider the clicked
directory to be selected, but rather the base directory
shown in the dialog, s.
https://bugs.kde.org/show_bug.cgi?id=406464 .
Therefore don't set the option when in a KDE Plasma desktop
environment (which the kde5 VCL plugin also doesn't do).
This works around the above issue in the Plasma desktop
integration.
Change-Id: Ib3d0978ab56b6e50ee45f7ad997ec051b35faf54
Reviewed-on: https://gerrit.libreoffice.org/71223
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn at posteo.de>
(cherry picked from commit 9fc0dbcd797f074ddb8ba379c876dd233cb5836e)
Reviewed-on: https://gerrit.libreoffice.org/71275
Tested-by: Michael Weghorn <m.weghorn at posteo.de>
diff --git a/vcl/unx/gtk3_kde5/kde5_filepicker.cxx b/vcl/unx/gtk3_kde5/kde5_filepicker.cxx
index 804aaa67e66a..1c3f1284bd20 100644
--- a/vcl/unx/gtk3_kde5/kde5_filepicker.cxx
+++ b/vcl/unx/gtk3_kde5/kde5_filepicker.cxx
@@ -63,7 +63,16 @@ KDE5FilePicker::KDE5FilePicker(QObject* parent)
void KDE5FilePicker::enableFolderMode()
{
_dialog->setOption(QFileDialog::ShowDirsOnly, true);
- _dialog->setFileMode(QFileDialog::Directory);
+ // Workaround for https://bugs.kde.org/show_bug.cgi?id=406464 :
+ // Don't set file mode to QFileDialog::Directory when native KDE Plasma 5
+ // file dialog is used, since clicking on directory "bar" inside directory "foo"
+ // and then confirming would return "foo" rather than "foo/bar";
+ // on the other hand, non-native file dialog needs 'QFileDialog::Directory'
+ // and doesn't allow folder selection otherwise
+ if (Application::GetDesktopEnvironment() != "KDE5")
+ {
+ _dialog->setFileMode(QFileDialog::Directory);
+ }
}
KDE5FilePicker::~KDE5FilePicker()
More information about the Libreoffice-commits
mailing list