summaryrefslogtreecommitdiff
path: root/vcl/unx/gtk3_kde5/kde5_filepicker.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/unx/gtk3_kde5/kde5_filepicker.cxx')
-rw-r--r--vcl/unx/gtk3_kde5/kde5_filepicker.cxx11
1 files changed, 10 insertions, 1 deletions
diff --git a/vcl/unx/gtk3_kde5/kde5_filepicker.cxx b/vcl/unx/gtk3_kde5/kde5_filepicker.cxx
index 991486903c62..d31d6f0aa9ec 100644
--- a/vcl/unx/gtk3_kde5/kde5_filepicker.cxx
+++ b/vcl/unx/gtk3_kde5/kde5_filepicker.cxx
@@ -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()