summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@suse.com>2013-05-11 17:52:26 +0100
committerMichael Meeks <michael.meeks@suse.com>2013-05-11 17:53:25 +0100
commitfbc486a449808d1d9261f67ffaa4f0213e80787e (patch)
tree73ba9d926006ad80d81cb326bcf253dcfed05638
parent8659ca5c350b9b08fb5f343c68955cdd6d361c96 (diff)
fdo#64311 - fix pre-processor conditionals & don't bail-out without gnome-vfs.
Change-Id: Ia7a805c95625b52fc99face000587692de21461e
-rw-r--r--desktop/Library_sofficeapp.mk1
-rw-r--r--desktop/source/app/appinit.cxx43
-rw-r--r--vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx2
-rw-r--r--vcl/unx/gtk/fpicker/SalGtkFolderPicker.cxx2
4 files changed, 28 insertions, 20 deletions
diff --git a/desktop/Library_sofficeapp.mk b/desktop/Library_sofficeapp.mk
index 63969960408d..451c1d88233e 100644
--- a/desktop/Library_sofficeapp.mk
+++ b/desktop/Library_sofficeapp.mk
@@ -26,7 +26,6 @@ $(eval $(call gb_Library_use_sdk_api,sofficeapp))
$(eval $(call gb_Library_add_defs,sofficeapp,\
-DDESKTOP_DLLIMPLEMENTATION \
- $(if $(filter TRUE,$(ENABLE_GNOMEVFS)),-DGNOME_VFS_ENABLED) \
$(if $(filter WNT,$(OS)),-DENABLE_QUICKSTART_APPLET) \
$(if $(filter MACOSX,$(OS)),-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 05b3b300df1c..de9299b11158 100644
--- a/desktop/source/app/appinit.cxx
+++ b/desktop/source/app/appinit.cxx
@@ -20,6 +20,8 @@
#include <algorithm>
+#include <config_vclplug.h>
+
#include "app.hxx"
#include "cmdlineargs.hxx"
#include "desktopresid.hxx"
@@ -73,25 +75,32 @@ static void configureUcb()
// 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")
+#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);
+ }
+ }
+ catch ( const uno::Exception & )
{
- Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext();
- UniversalContentBroker::create(xContext)
- ->registerContentProvider(
- Reference<XContentProvider>(
- xContext->getServiceManager()->createInstanceWithContext("com.sun.star.ucb.GnomeVFSContentProvider", xContext),
- UNO_QUERY_THROW),
- ".*", false);
+ SAL_WARN( "desktop", "missing gnome-vfs component to initialize thread workaround" );
}
-#endif // GNOME_VFS_ENABLED
+#endif // ENABLE_GNOME_VFS
}
void Desktop::InitApplicationServiceManager()
diff --git a/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx b/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx
index b1b2d6087275..102e16e552ad 100644
--- a/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx
+++ b/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx
@@ -140,7 +140,7 @@ SalGtkFilePicker::SalGtkFilePicker( const uno::Reference< uno::XComponentContext
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 7c8790628c28..f9adefcd37c3 100644
--- a/vcl/unx/gtk/fpicker/SalGtkFolderPicker.cxx
+++ b/vcl/unx/gtk/fpicker/SalGtkFolderPicker.cxx
@@ -59,7 +59,7 @@ SalGtkFolderPicker::SalGtkFolderPicker( const uno::Reference< uno::XComponentCon
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 );