summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatúš Kukan <matus.kukan@gmail.com>2012-07-13 19:42:44 +0200
committerMatúš Kukan <matus.kukan@gmail.com>2012-07-17 16:40:23 +0200
commitf0685e2c69a3a31c2669c67d7638e7a1dbd203a3 (patch)
treeef665b78f2cfd4eb2be228e14760f54f1dd9bf4a
parenttubes: split TeleManager::connect method. (diff)
downloadcore-f0685e2c69a3a31c2669c67d7638e7a1dbd203a3.tar.gz
core-f0685e2c69a3a31c2669c67d7638e7a1dbd203a3.zip
tubes: create TeleManager when starting Collaboration dialog
And store the reference. I need to find a place where to unref it. Change-Id: I4a9d6d8dfadf94c21cfed06524f495e8e48b8323
-rw-r--r--sc/source/ui/collab/contacts.cxx20
-rw-r--r--sc/source/ui/collab/contacts.hxx3
-rw-r--r--sc/source/ui/collab/sendfunc.cxx2
-rw-r--r--sc/source/ui/view/cellsh3.cxx5
4 files changed, 15 insertions, 15 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
}
}
diff --git a/sc/source/ui/collab/contacts.hxx b/sc/source/ui/collab/contacts.hxx
index 404a6fcda749..9c8345e850fb 100644
--- a/sc/source/ui/collab/contacts.hxx
+++ b/sc/source/ui/collab/contacts.hxx
@@ -28,9 +28,8 @@
#include "sal/config.h"
-class TeleManager;
namespace tubes {
- void createContacts( const TeleManager *pManager );
+ void createContacts();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/collab/sendfunc.cxx b/sc/source/ui/collab/sendfunc.cxx
index c1962f907d46..4e91b7ee6137 100644
--- a/sc/source/ui/collab/sendfunc.cxx
+++ b/sc/source/ui/collab/sendfunc.cxx
@@ -345,7 +345,7 @@ sal_Bool ScDocFuncSend::SetNormalString( const ScAddress& rPos, const String& rT
SendFile( rText );
if ( rtl::OUString( rText ) == "contacts" )
- tubes::createContacts( mpManager );
+ tubes::createContacts();
return true; // needs some code auditing action
}
diff --git a/sc/source/ui/view/cellsh3.cxx b/sc/source/ui/view/cellsh3.cxx
index a57bfda5470f..19b25410df1a 100644
--- a/sc/source/ui/view/cellsh3.cxx
+++ b/sc/source/ui/view/cellsh3.cxx
@@ -53,9 +53,8 @@
#include "scabstdlg.hxx"
#ifdef ENABLE_TELEPATHY
-#include <tubes/manager.hxx>
namespace tubes {
- void createContacts( const TeleManager *pManager );
+ void createContacts();
}
#endif
@@ -120,7 +119,7 @@ void ScCellShell::Execute( SfxRequest& rReq )
case SID_COLLABORATION:
#ifdef ENABLE_TELEPATHY
- tubes::createContacts( TeleManager::get() );
+ tubes::createContacts();
#endif
break;