[Libreoffice-commits] core.git: Branch 'libreoffice-6-2' - vcl/unx

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Jan 30 19:23:31 UTC 2019


 vcl/unx/kde5/KDE5SalInstance.cxx |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

New commits:
commit 71562327d4f4d9d46b129fbb41184f21116ba78d
Author:     Michael Weghorn <m.weghorn at posteo.de>
AuthorDate: Wed Jan 30 08:53:19 2019 +0100
Commit:     Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Wed Jan 30 20:23:05 2019 +0100

    tdf#122752 kde5: Use plain qt5 fpicker for non-Plasma desktops
    
    Since KDE5FilePicker relies on the Plasma-specific KFileWidget
    to be present for inserting custom controls, this doesn't work
    on non-Plasma desktops, resulting in missing controls.
    
    Therefore, use a plain (non-native) Qt5FilePicker for the non-Plasma case.
    
    Change-Id: I163af89ecd7eab800d55baa2ce057802caed262c
    Reviewed-on: https://gerrit.libreoffice.org/67106
    Tested-by: Jenkins
    Reviewed-by: Katarina Behrens <Katarina.Behrens at cib.de>
    (cherry picked from commit c902b3a96dcfbc52e53164f108e605547e598bc7)
    Reviewed-on: https://gerrit.libreoffice.org/67131
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/vcl/unx/kde5/KDE5SalInstance.cxx b/vcl/unx/kde5/KDE5SalInstance.cxx
index 484920d01e97..401afbcfa2dd 100644
--- a/vcl/unx/kde5/KDE5SalInstance.cxx
+++ b/vcl/unx/kde5/KDE5SalInstance.cxx
@@ -71,7 +71,15 @@ KDE5SalInstance::createFilePicker(const uno::Reference<uno::XComponentContext>&
         return Q_EMIT createFilePickerSignal(xMSF);
     }
 
-    return uno::Reference<ui::dialogs::XFilePicker2>(new KDE5FilePicker(QFileDialog::ExistingFile));
+    // In order to insert custom controls, KDE5FilePicker currently relies on KFileWidget
+    // being used in the native file picker, which is only the case for KDE Plasma.
+    // Therefore, return the plain qt5 one in order to not lose custom controls.
+    if (Application::GetDesktopEnvironment() == "KDE5")
+    {
+        return uno::Reference<ui::dialogs::XFilePicker2>(
+            new KDE5FilePicker(QFileDialog::ExistingFile));
+    }
+    return Qt5Instance::createFilePicker(xMSF);
 }
 
 uno::Reference<ui::dialogs::XFolderPicker2>


More information about the Libreoffice-commits mailing list