Kaydet (Commit) 8f4af22c authored tarafından Michael Weghorn's avatar Michael Weghorn Kaydeden (comit) Katarina Behrens

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: 's avatarMichael Weghorn <m.weghorn@posteo.de>
(cherry picked from commit 9fc0dbcd)
Reviewed-on: https://gerrit.libreoffice.org/71274Reviewed-by: 's avatarKatarina Behrens <Katarina.Behrens@cib.de>
üst 97d1ba1d
......@@ -65,7 +65,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()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment