diff options
Diffstat (limited to 'patches/dev300/gnome-vfs-late-init.diff')
-rw-r--r-- | patches/dev300/gnome-vfs-late-init.diff | 167 |
1 files changed, 0 insertions, 167 deletions
diff --git a/patches/dev300/gnome-vfs-late-init.diff b/patches/dev300/gnome-vfs-late-init.diff deleted file mode 100644 index b06450be3..000000000 --- a/patches/dev300/gnome-vfs-late-init.diff +++ /dev/null @@ -1,167 +0,0 @@ -From d4d1dc96392bbe30dce804a7f9223e1631b0e704 Mon Sep 17 00:00:00 2001 -From: Jan Holesovsky <kendy@suse.cz> -Date: Fri, 14 May 2010 16:54:52 +0200 -Subject: [PATCH 104/768] gnome-vfs-late-init.diff - ---- - desktop/source/app/appinit.cxx | 25 +------------- - ucb/prj/build.lst | 2 +- - ucb/source/ucp/gvfs/gvfs_provider.cxx | 61 +++++++++++++++++++++++++++++---- - ucb/source/ucp/gvfs/makefile.mk | 1 + - 4 files changed, 57 insertions(+), 32 deletions(-) - -diff --git desktop/source/app/appinit.cxx desktop/source/app/appinit.cxx -index 25798d9..8a48325 100644 ---- desktop/source/app/appinit.cxx -+++ desktop/source/app/appinit.cxx -@@ -150,7 +150,7 @@ static bool configureUcb(bool bServer, rtl::OUString const & rPortalConnect) - { - Reference<XContentProviderManager> xCPM = - cb->getContentProviderManagerInterface(); --#if 0 -+ - try - { - -@@ -171,30 +171,7 @@ static bool configureUcb(bool bServer, rtl::OUString const & rPortalConnect) - } catch (...) - { - } --#else -- -- // Workaround for P1 #124597#. Instanciate GNOME-VFS-UCP in the thread that initialized -- // GNOME in order to avoid a deadlock that may occure in case UCP gets initialized from -- // a different thread. The latter may happen when calling the Office remotely via UNO. -- // THIS IS NOT A FIX, JUST A WORKAROUND! -- -- try -- { -- Reference<XContentProvider> xCP( -- xServiceFactory->createInstance( -- rtl::OUString::createFromAscii( -- "com.sun.star.ucb.GnomeVFSContentProvider")), -- UNO_QUERY); -- if(xCP.is()) -- xCPM->registerContentProvider( -- xCP, -- rtl::OUString::createFromAscii(".*"), -- false); -- } catch (...) -- { -- } - } --#endif - } - } catch (RuntimeException e) { - } -diff --git ucb/prj/build.lst ucb/prj/build.lst -index a4d7ef6..866d8a4 100644 ---- ucb/prj/build.lst -+++ ucb/prj/build.lst -@@ -1,4 +1,4 @@ --uc ucb : cppuhelper CURL:curl OPENSSL:openssl NEON:neon LIBXML2:libxml2 offapi sal salhelper ucbhelper udkapi comphelper NULL -+uc ucb : cppuhelper CURL:curl OPENSSL:openssl NEON:neon LIBXML2:libxml2 offapi sal salhelper ucbhelper udkapi comphelper vcl NULL - uc ucb usr1 - all uc_mkout NULL - uc ucb\inc nmake - all uc_inc NULL - uc ucb\source\regexp nmake - all uc_regexp uc_inc NULL -diff --git ucb/source/ucp/gvfs/gvfs_provider.cxx ucb/source/ucp/gvfs/gvfs_provider.cxx -index 92fa95c..1b1fefb 100644 ---- ucb/source/ucp/gvfs/gvfs_provider.cxx -+++ ucb/source/ucp/gvfs/gvfs_provider.cxx -@@ -29,6 +29,9 @@ - #include "precompiled_ucb.hxx" - - #include <ucbhelper/contentidentifier.hxx> -+#include <osl/mutex.hxx> -+#include <vcl/svapp.hxx> -+ - #include <libgnomevfs/gnome-vfs-init.h> - #include "gvfs_provider.hxx" - #include "gvfs_content.hxx" -@@ -195,6 +198,55 @@ component_writeInfo( void */*pServiceManager*/, - ::gvfs::ContentProvider::getImplementationName_Static(), - ::gvfs::ContentProvider::getSupportedServiceNames_Static() ); - } -+ -+/* This class is here to be able to initialize gnome-vfs in the main thread */ -+class GnomeVFSInitializator -+{ -+private: -+ osl::Mutex m_aLock; -+ bool m_bInitialized; -+ -+public: -+ GnomeVFSInitializator() : m_bInitialized( false ) {} -+ -+ void init() -+ { -+ Application::PostUserEvent( LINK( this, GnomeVFSInitializator, ImplInitializeGnomeVFS ) ); -+ -+ // cannot use a condition variable here, leads to a deadlock -+ while (1) -+ { -+ { -+ osl::MutexGuard aGuard( m_aLock ); -+ if ( m_bInitialized ) -+ break; -+ } -+ Application::Yield(); -+ } -+ } -+ -+private: -+ DECL_LINK( ImplInitializeGnomeVFS, void* ); -+}; -+ -+IMPL_LINK( GnomeVFSInitializator, ImplInitializeGnomeVFS, void*, EMPTYARG ) -+{ -+ osl::MutexGuard aGuard( osl::Mutex::getGlobalMutex() ); -+ -+ // this must be performed in the same thread where we initialized -+ // Gtk+ (if we did) -+ if ( !gnome_vfs_initialized () ) -+ gnome_vfs_init (); -+ if ( !auth_queue ) -+ auth_queue = g_private_new( auth_queue_destroy ); -+ -+ m_aLock.acquire(); -+ m_bInitialized = true; -+ m_aLock.release(); -+ -+ return 0; -+} -+ - extern "C" void * SAL_CALL - component_getFactory( const sal_Char *pImplName, - void *pServiceManager, -@@ -202,13 +254,8 @@ component_getFactory( const sal_Char *pImplName, - { - void * pRet = 0; - -- { -- osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() ); -- if (!gnome_vfs_initialized ()) -- gnome_vfs_init (); -- if (!auth_queue) -- auth_queue = g_private_new( auth_queue_destroy ); -- } -+ GnomeVFSInitializator aInitializator; -+ aInitializator.init(); - - uno::Reference< lang::XMultiServiceFactory > xSMgr - (reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ) ); -diff --git ucb/source/ucp/gvfs/makefile.mk ucb/source/ucp/gvfs/makefile.mk -index a0e8a0b..44f5a8b 100644 ---- ucb/source/ucp/gvfs/makefile.mk -+++ ucb/source/ucp/gvfs/makefile.mk -@@ -73,6 +73,7 @@ SHL1STDLIBS=\ - $(CPPULIB) \ - $(SALLIB) \ - $(SALHELPERLIB) \ -+ $(VCLLIB) \ - $(UCBHELPERLIB) - - SHL1STDLIBS+=$(PKGCONFIG_LIBS) --- -1.7.0.1 - |