vcl/Library_vclplug_gtk3_kde5.mk           |    2 ++
 vcl/unx/gtk3_kde5/gtk3_kde5_filepicker.cxx |    8 ++++++++
 2 files changed, 10 insertions(+)

New commits:
commit 1674c6964b585d944bcb34be1d937e7558a97453
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Wed Apr 24 15:06:04 2019 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Fri Apr 26 12:44:13 2019 +0200

    tdf#124598 gtk3_kde5: Link gtk3 side against kf5 libs
    
    The separate filepicker executable 'lo_kde5filepicker'
    used by the gtk3_kde5 VCL plugin needs the KF5 libraries
    (in particular the 'KFileWidget' class) in order to
    provide custom controls in the Plasma-native QFileDialog.
    
    The gtk3 side ('lo_kde5filepicker') itself doesn't use
    any functionality from KF5 libraries itself and therefore
    didn't link against those.
    
    When determining which VCL plugin to use on LibreOffice
    start, a 'dlopen()' is used on the libraries of the
    potential VCL plugins, which fails if linked libraries
    are not available, so unsuitable VCL plugin are skipped.
    
    This mechanism didn't work for the gtk3_kde5 VCL plugin
    if KF5 libraries were not installed, since the 'dlopen()'
    on 'libvclplug_gtk3_kde5lo.so' would succeed, but starting
    the 'lo_kde5filepicker' process would later fail at runtime
    due to the missing libraries.
    
    To avoid this, make 'libvclplug_gtk3_kde5lo.so' link
    against KF5 libraries as well to prevent gtk3_kde5 from
    being used unless all required libraries are actually present.
    
    Add a dummy KFileWidget use in Gtk3KDE5FilePicker to prevent
    smart linkers from not linking unused libraries despite linker
    flags.
    
    While this is a hack, it seems to be acceptable, in
    particular since gtk3_kde5 is more meant as a temporary
    solution supposed to be dropped at a later point in time
    in favor of the pure kde5 VCL plugin.
    
    Change-Id: I3a37daaeb1307b4f24f6fd75d7b6ec5ffaade0fd
    Reviewed-on: https://gerrit.libreoffice.org/71237
    Reviewed-by: Katarina Behrens <katarina.behr...@cib.de>
    Tested-by: Jenkins

diff --git a/vcl/Library_vclplug_gtk3_kde5.mk b/vcl/Library_vclplug_gtk3_kde5.mk
index e725e077f55e..d7f9b9d11107 100644
--- a/vcl/Library_vclplug_gtk3_kde5.mk
+++ b/vcl/Library_vclplug_gtk3_kde5.mk
@@ -39,6 +39,7 @@ $(eval $(call gb_Library_add_cxxflags,vclplug_gtk3_kde5,\
 
 $(eval $(call gb_Library_add_defs,vclplug_gtk3_kde5,\
     -DVCLPLUG_GTK_IMPLEMENTATION -DVCLPLUG_GTK3_KDE5_IMPLEMENTATION \
+    $(KF5_CFLAGS) \
 ))
 
 $(eval $(call gb_Library_use_custom_headers,vclplug_gtk3_kde5,\
@@ -124,6 +125,7 @@ ifeq ($(OS),LINUX)
 $(eval $(call gb_Library_add_libs,vclplug_gtk3_kde5,\
        -lm \
        -ldl \
+       $(KF5_LIBS) \
 ))
 endif
 
diff --git a/vcl/unx/gtk3_kde5/gtk3_kde5_filepicker.cxx 
b/vcl/unx/gtk3_kde5/gtk3_kde5_filepicker.cxx
index 47398d01f5c0..adf9ea87d455 100644
--- a/vcl/unx/gtk3_kde5/gtk3_kde5_filepicker.cxx
+++ b/vcl/unx/gtk3_kde5/gtk3_kde5_filepicker.cxx
@@ -17,6 +17,9 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <QUrl>
+#include <KFileWidget>
+
 #include "gtk3_kde5_filepicker.hxx"
 
 #include <com/sun/star/lang/DisposedException.hpp>
@@ -71,6 +74,11 @@ Gtk3KDE5FilePicker::Gtk3KDE5FilePicker(const 
uno::Reference<uno::XComponentConte
     : Gtk3KDE5FilePicker_Base(_helperMutex)
 {
     setMultiSelectionMode(false);
+
+    // tdf#124598 dummy KWidget use to make gtk3_kde5 VCL plugin link against 
KIO libraries
+    QString sDummyStr;
+    QUrl aUrl = KFileWidget::getStartUrl(QUrl(), sDummyStr);
+    aUrl.setPath("/dev/null");
 }
 
 Gtk3KDE5FilePicker::~Gtk3KDE5FilePicker() = default;
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to