diff options
author | Matúš Kukan <matus.kukan@gmail.com> | 2012-07-13 19:42:44 +0200 |
---|---|---|
committer | Matúš Kukan <matus.kukan@gmail.com> | 2012-07-17 16:40:23 +0200 |
commit | f0685e2c69a3a31c2669c67d7638e7a1dbd203a3 (patch) | |
tree | ef665b78f2cfd4eb2be228e14760f54f1dd9bf4a /sc/source/ui/collab/contacts.cxx | |
parent | fd9d7f35d9cec7584061d9930c05189ec5838036 (diff) |
tubes: create TeleManager when starting Collaboration dialog
And store the reference. I need to find a place where to unref it.
Change-Id: I4a9d6d8dfadf94c21cfed06524f495e8e48b8323
Diffstat (limited to 'sc/source/ui/collab/contacts.cxx')
-rw-r--r-- | sc/source/ui/collab/contacts.cxx | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/sc/source/ui/collab/contacts.cxx b/sc/source/ui/collab/contacts.cxx index f15c9e0f63b1..2fc8e1af193c 100644 --- a/sc/source/ui/collab/contacts.cxx +++ b/sc/source/ui/collab/contacts.cxx @@ -50,6 +50,7 @@ class TubeContacts : public ModelessDialog PushButton maBtnListen; SvxSimpleTableContainer maListContainer; SvxSimpleTable maList; + TeleManager* mpManager; DECL_LINK( BtnConnectHdl, void * ); DECL_LINK( BtnListenHdl, void * ); @@ -99,8 +100,7 @@ class TubeContacts : public ModelessDialog TpAccount* pAccount = pAC->mpAccount; TpContact* pContact = pAC->mpContact; fprintf( stderr, "picked %s\n", tp_contact_get_identifier( pContact ) ); - TeleManager *pManager = TeleManager::get(); - if (!pManager->startBuddySession( pAccount, pContact )) + if (!mpManager->startBuddySession( pAccount, pContact )) fprintf( stderr, "could not start session with %s\n", tp_contact_get_identifier( pContact ) ); } @@ -115,8 +115,7 @@ class TubeContacts : public ModelessDialog { TpAccount* pAccount = pAC->mpAccount; fprintf( stderr, "picked %s\n", tp_account_get_display_name( pAccount ) ); - TeleManager *pManager = TeleManager::get(); - if (!pManager->startGroupSession( pAccount, rtl::OUString("liboroom"), rtl::OUString("conference.jabber.org") )) + if (!mpManager->startGroupSession( pAccount, rtl::OUString("liboroom"), rtl::OUString("conference.jabber.org") )) fprintf( stderr, "could not start group session\n" ); } } @@ -130,6 +129,9 @@ public: maListContainer( this, ScResId( CTL_LIST ) ), maList( maListContainer ) { + // FIXME: Who should really own TeleManager and where it can be destroyed ? + mpManager = TeleManager::get(); + maBtnConnect.SetClickHdl( LINK( this, TubeContacts, BtnConnectHdl ) ); maBtnListen.SetClickHdl( LINK( this, TubeContacts, BtnListenHdl ) ); @@ -155,11 +157,11 @@ public: RTL_TEXTENCODING_UTF8 ); } - void Populate( const TeleManager *pManager ) + void Populate() { - if (!pManager) + if (!mpManager) return ; - ContactList *pContacts = pManager->getContactList(); + ContactList *pContacts = mpManager->getContactList(); if ( pContacts ) { fprintf( stderr, "contacts !\n" ); @@ -222,11 +224,11 @@ IMPL_LINK_NOARG( TubeContacts, BtnListenHdl ) #endif namespace tubes { -void createContacts( const TeleManager *pManager ) +void createContacts() { #ifdef CONTACTS_DLG TubeContacts *pContacts = new TubeContacts(); - pContacts->Populate( pManager ); + pContacts->Populate(); #endif } } |