From b12954531953fb8ad585847fe42677d714991ef1 Mon Sep 17 00:00:00 2001 From: Matúš Kukan Date: Fri, 20 Jul 2012 21:31:30 +0200 Subject: tubes: init TeleManager in desktop - register clients when we run --invisible - create ScDocFuncSend only if we are going to use it Change-Id: I7e33cd5a2e42e34a055146dc6c2bdac3657d6529 --- tubes/inc/tubes/manager.hxx | 1 + tubes/source/manager.cxx | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) (limited to 'tubes') diff --git a/tubes/inc/tubes/manager.hxx b/tubes/inc/tubes/manager.hxx index a112b6118a94..a47a5663852e 100644 --- a/tubes/inc/tubes/manager.hxx +++ b/tubes/inc/tubes/manager.hxx @@ -81,6 +81,7 @@ public: TUBES_DLLPUBLIC static TeleManager* get(); TUBES_DLLPUBLIC void unref(); + TUBES_DLLPUBLIC bool init( bool bListen ); /** Connect to DBus and create AccountManager. */ TUBES_DLLPUBLIC bool createAccountManager(); diff --git a/tubes/source/manager.cxx b/tubes/source/manager.cxx index d16422dacb8c..eeccbe922b89 100644 --- a/tubes/source/manager.cxx +++ b/tubes/source/manager.cxx @@ -420,6 +420,7 @@ TeleManager * TeleManager::get() { MutexGuard aGuard( GetAnotherMutex()); + SAL_INFO( "tubes", "TeleManager::get: count: " << nAnotherRefCount ); if (!pSingleton) pSingleton = new TeleManager(); @@ -435,8 +436,24 @@ TeleManager::unref() delete pSingleton; pSingleton = NULL; } + SAL_INFO( "tubes", "TeleManager::unref: count: " << nAnotherRefCount ); } +bool TeleManager::init( bool bListen ) +{ + if (createAccountManager()) + { + prepareAccountManager(); + if (bListen && !registerClients()) + SAL_WARN( "tubes", "TeleManager::init: Could not register client handlers." ); + + return true; + } + else + SAL_WARN( "tubes", "TeleManager::init: Could not create AccountManager." ); + + return false; +} bool TeleManager::createAccountManager() { -- cgit