summaryrefslogtreecommitdiff
path: root/tubes
diff options
context:
space:
mode:
authorMatúš Kukan <matus.kukan@gmail.com>2012-07-26 10:30:44 +0200
committerMatúš Kukan <matus.kukan@gmail.com>2012-07-26 15:59:18 +0200
commitc55b2d0b32dd210c2a809ce2b5ebca12bfb5b1d8 (patch)
tree9305ee0a0d9c2a763a76f476006bd715f753f856 /tubes
parent27d3fc221d042decbd84b72719107547562d2e12 (diff)
tubes: TeleManger's GMainLoop* now unused
Change-Id: I99b482a60155c596c4b64534f62ce4c9d4d9a94b
Diffstat (limited to 'tubes')
-rw-r--r--tubes/inc/tubes/manager.hxx11
-rw-r--r--tubes/source/manager.cxx35
2 files changed, 6 insertions, 40 deletions
diff --git a/tubes/inc/tubes/manager.hxx b/tubes/inc/tubes/manager.hxx
index a47a5663852e..0e96826337da 100644
--- a/tubes/inc/tubes/manager.hxx
+++ b/tubes/inc/tubes/manager.hxx
@@ -71,12 +71,8 @@ public:
/** Prepare tube manager with account and service to be offered/listened
to.
-
- @param bCreateOwnGMainLoop
- Whether to create and iterate an own GMainLoop. For testing
- purposes when no GMainLoop is available.
*/
- TeleManager( bool bCreateOwnGMainLoop = false );
+ TeleManager();
~TeleManager();
TUBES_DLLPUBLIC static TeleManager* get();
@@ -142,11 +138,6 @@ public:
void disconnect();
- /// Only for use with MainLoopFlusher
- GMainLoop* getMainLoop() const;
-
- GMainContext* getMainContext() const;
-
static rtl::OString createUuid();
diff --git a/tubes/source/manager.cxx b/tubes/source/manager.cxx
index 80f9c1c5b06b..c60388ffd296 100644
--- a/tubes/source/manager.cxx
+++ b/tubes/source/manager.cxx
@@ -89,7 +89,6 @@ TeleManager* TeleManager::pSingleton = NULL;
class TeleManagerImpl
{
public:
- GMainLoop* mpLoop;
TpAutomaticClientFactory* mpFactory;
TpBaseClient* mpClient;
TpBaseClient* mpFileTransferClient;
@@ -387,7 +386,7 @@ static void TeleManager_AccountManagerReadyHandler(
}
-TeleManager::TeleManager( bool bCreateOwnGMainLoop )
+TeleManager::TeleManager()
:
mbChannelReadyHandlerInvoked( false)
{
@@ -399,11 +398,6 @@ TeleManager::TeleManager( bool bCreateOwnGMainLoop )
++nRefCount;
if (!pImpl)
pImpl = new TeleManagerImpl;
-
- // We need a main loop, else no callbacks.
- /* TODO: could the loop be run in another thread? */
- if (bCreateOwnGMainLoop && !pImpl->mpLoop)
- pImpl->mpLoop = g_main_loop_new( NULL, FALSE);
}
@@ -860,53 +854,37 @@ rtl::OString TeleManager::getFullObjectPath()
void TeleManager::iterateLoop()
{
- GMainContext* pContext = getMainContext();
- g_main_context_iteration( pContext, TRUE);
+ g_main_context_iteration( NULL, TRUE );
}
void TeleManager::iterateLoop( CallBackInvokedFunc pFunc )
{
- GMainContext* pContext = getMainContext();
while (!(*pFunc)())
{
- g_main_context_iteration( pContext, TRUE);
+ g_main_context_iteration( NULL, TRUE );
}
}
void TeleManager::iterateLoop( ManagerCallBackInvokedFunc pFunc )
{
- GMainContext* pContext = getMainContext();
while (!(this->*pFunc)())
{
- g_main_context_iteration( pContext, TRUE);
+ g_main_context_iteration( NULL, TRUE );
}
}
void TeleManager::iterateLoop( const TeleConference* pConference, ConferenceCallBackInvokedFunc pFunc )
{
- GMainContext* pContext = getMainContext();
while (!(pConference->*pFunc)())
{
- g_main_context_iteration( pContext, TRUE);
+ g_main_context_iteration( NULL, TRUE );
}
}
-GMainLoop* TeleManager::getMainLoop() const
-{
- return pImpl->mpLoop;
-}
-
-
-GMainContext* TeleManager::getMainContext() const
-{
- return (pImpl->mpLoop ? g_main_loop_get_context( pImpl->mpLoop) : NULL);
-}
-
-
// static
rtl::OString TeleManager::createUuid()
{
@@ -958,7 +936,6 @@ void TeleManager::addSuffixToNames( const char* pName )
TeleManagerImpl::TeleManagerImpl()
:
- mpLoop( NULL),
mpFactory( NULL),
mpClient( NULL),
mpFileTransferClient( NULL),
@@ -986,8 +963,6 @@ TeleManagerImpl::~TeleManagerImpl()
g_object_unref( mpAccountManager);
if (mpContactList)
delete mpContactList;
- if (mpLoop)
- g_main_loop_unref( mpLoop);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */