summaryrefslogtreecommitdiff
path: root/desktop
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 /desktop
parent8659ca5c350b9b08fb5f343c68955cdd6d361c96 (diff)
fdo#64311 - fix pre-processor conditionals & don't bail-out without gnome-vfs.
Change-Id: Ia7a805c95625b52fc99face000587692de21461e
Diffstat (limited to 'desktop')
-rw-r--r--desktop/Library_sofficeapp.mk1
-rw-r--r--desktop/source/app/appinit.cxx43
2 files changed, 26 insertions, 18 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()