Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/3882

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/82/3882/1

fdo#64311 - fix pre-processor conditionals & don't bail-out without gnome-vfs.

(cherry picked from commit fbc486a449808d1d9261f67ffaa4f0213e80787e)

Signed-off-by: Fridrich Štrba <fridrich.strba@bluewin.ch>

Conflicts:
        desktop/Library_sofficeapp.mk
        desktop/source/app/appinit.cxx

fdo#64311 - fix namespace issue / compile failure.

(cherry picked from commit 8627bf17d565e085bb204b91dfe596c4a0430d1d)

Change-Id: Ia7a805c95625b52fc99face000587692de21461e
7ce3837a1a451560f5867786bb20d8280e7bef23
---
M desktop/Library_sofficeapp.mk
M desktop/source/app/appinit.cxx
M vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx
M vcl/unx/gtk/fpicker/SalGtkFolderPicker.cxx
4 files changed, 28 insertions(+), 22 deletions(-)



diff --git a/desktop/Library_sofficeapp.mk b/desktop/Library_sofficeapp.mk
index 4a6fccf..8aa9d54 100644
--- a/desktop/Library_sofficeapp.mk
+++ b/desktop/Library_sofficeapp.mk
@@ -38,7 +38,7 @@
 
 $(eval $(call gb_Library_add_defs,sofficeapp,\
     -DDESKTOP_DLLIMPLEMENTATION \
-    $(if $(filter TRUE,$(ENABLE_GNOMEVFS)),-DGNOME_VFS_ENABLED) \
+    $(if $(filter TRUE,$(ENABLE_GNOMEVFS)),-DENABLE_GNOME_VFS) \
     $(if $(filter WNT,$(GUI)),-DENABLE_QUICKSTART_APPLET) \
     $(if $(filter aqua,$(GUIBASE)),-DENABLE_QUICKSTART_APPLET) \
     $(if $(filter TRUE,$(ENABLE_SYSTRAY_GTK)),-DENABLE_QUICKSTART_APPLET) \
diff --git a/desktop/source/app/appinit.cxx b/desktop/source/app/appinit.cxx
index 7012243..d3823e9 100644
--- a/desktop/source/app/appinit.cxx
+++ b/desktop/source/app/appinit.cxx
@@ -80,26 +80,32 @@
     // createInstance w/o args directly to obtain an instance:
     UniversalContentBroker::create(comphelper::getProcessComponentContext());
 
-#ifdef GNOME_VFS_ENABLED
-    // Instantiate GNOME-VFS UCP in the thread that initialized GNOME in order
-    // to avoid a deadlock that may occure in case the UCP gets initialized from
-    // a different thread (which may happen when calling remotely via UNO); this
-    // is not a fix, just a workaround:
-    Reference< XCurrentContext > xCurrentContext(getCurrentContext());
-    Any aValue(xCurrentContext->getValueByName("system.desktop-environment"));
-    OUString aDesktopEnvironment;
-    if ((aValue >>= aDesktopEnvironment) && aDesktopEnvironment == "GNOME")
-    {
-        UniversalContentBroker::create(
-            comphelper::getProcessComponentContext())->
-            registerContentProvider(
-                Reference<XContentProvider>(
-                    comphelper::getProcessServiceFactory()->createInstance(
-                        "com.sun.star.ucb.GnomeVFSContentProvider"),
-                    UNO_QUERY_THROW),
-                ".*", false);
+#if ENABLE_GNOME_VFS
+    try {
+        // Instantiate GNOME-VFS UCP in the thread that initialized GNOME in order
+        // to avoid a deadlock that may occure in case the UCP gets initialized from
+        // a different thread (which may happen when calling remotely via UNO); this
+        // is not a fix, just a workaround:
+        Reference< XCurrentContext > xCurrentContext(getCurrentContext());
+        Any aValue(xCurrentContext->getValueByName("system.desktop-environment"));
+        OUString aDesktopEnvironment;
+        if ((aValue >>= aDesktopEnvironment) && aDesktopEnvironment == "GNOME")
+        {
+            Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext();
+            UniversalContentBroker::create(xContext)
+                ->registerContentProvider(
+                        Reference<XContentProvider>(
+                        xContext->getServiceManager()->createInstanceWithContext(
+                                "com.sun.star.ucb.GnomeVFSContentProvider", xContext),
+                        UNO_QUERY_THROW),
+                        ".*", false);
+        }
     }
-#endif // GNOME_VFS_ENABLED
+    catch ( const Exception & )
+    {
+        OSL_FAIL( "missing gnome-vfs component to initialize thread workaround" );
+    }
+#endif // ENABLE_GNOME_VFS
 }
 
 void Desktop::InitApplicationServiceManager()
diff --git a/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx b/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx
index f2e1141..a794aff 100644
--- a/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx
+++ b/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx
@@ -146,7 +146,7 @@
 
     gtk_dialog_set_default_response( GTK_DIALOG (m_pDialog), GTK_RESPONSE_ACCEPT );
 
-#if defined(ENABLE_GNOME_VFS) || defined (ENABLE_GIO)
+#if ENABLE_GNOME_VFS || ENABLE_GIO
     gtk_file_chooser_set_local_only( GTK_FILE_CHOOSER( m_pDialog ), sal_False );
 #endif
     gtk_file_chooser_set_select_multiple( GTK_FILE_CHOOSER( m_pDialog ), sal_False );
diff --git a/vcl/unx/gtk/fpicker/SalGtkFolderPicker.cxx b/vcl/unx/gtk/fpicker/SalGtkFolderPicker.cxx
index b80d6f5..d4eb8e0 100644
--- a/vcl/unx/gtk/fpicker/SalGtkFolderPicker.cxx
+++ b/vcl/unx/gtk/fpicker/SalGtkFolderPicker.cxx
@@ -56,7 +56,7 @@
         GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, (char *)NULL );
 
     gtk_dialog_set_default_response( GTK_DIALOG (m_pDialog), GTK_RESPONSE_ACCEPT );
-#if defined(ENABLE_GNOME_VFS) || defined (ENABLE_GIO)
+#if ENABLE_GNOME_VFS || ENABLE_GIO
     gtk_file_chooser_set_local_only( GTK_FILE_CHOOSER( m_pDialog ), sal_False );
 #endif
     gtk_file_chooser_set_select_multiple( GTK_FILE_CHOOSER( m_pDialog ), sal_False );

-- 
To view, visit https://gerrit.libreoffice.org/3882
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia7a805c95625b52fc99face000587692de21461e
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: libreoffice-4-0
Gerrit-Owner: Fridrich Strba <fridrich@documentfoundation.org>
Gerrit-Reviewer: Michael Meeks <michael.meeks@suse.com>


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.