summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@suse.com>2013-05-11 17:52:26 +0100
committerPetr Mladek <pmladek@suse.cz>2013-05-23 16:37:30 +0200
commitb70417b1eea6edcc4d549c9d22c69a8c8203554b (patch)
treedaa6ea1d72e81f0fb0b694123b9f6621e7545ed1
parente456b97f482a8a4589cb86d35bc1d5648c262815 (diff)
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 Reviewed-on: https://gerrit.libreoffice.org/3882 Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org> Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
-rw-r--r--desktop/Library_sofficeapp.mk2
-rw-r--r--desktop/source/app/appinit.cxx42
2 files changed, 25 insertions, 19 deletions
diff --git a/desktop/Library_sofficeapp.mk b/desktop/Library_sofficeapp.mk
index 4a6fccf940ab..8aa9d54345e3 100644
--- a/desktop/Library_sofficeapp.mk
+++ b/desktop/Library_sofficeapp.mk
@@ -38,7 +38,7 @@ $(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 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 7012243704fc..92ab2bc3d2ed 100644
--- a/desktop/source/app/appinit.cxx
+++ b/desktop/source/app/appinit.cxx
@@ -80,26 +80,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")
+#ifdef 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 Exception & )
{
- UniversalContentBroker::create(
- comphelper::getProcessComponentContext())->
- registerContentProvider(
- Reference<XContentProvider>(
- comphelper::getProcessServiceFactory()->createInstance(
- "com.sun.star.ucb.GnomeVFSContentProvider"),
- UNO_QUERY_THROW),
- ".*", false);
+ OSL_FAIL( "missing gnome-vfs component to initialize thread workaround" );
}
-#endif // GNOME_VFS_ENABLED
+#endif // ENABLE_GNOME_VFS
}
void Desktop::InitApplicationServiceManager()