summaryrefslogtreecommitdiff
path: root/tubes
diff options
context:
space:
mode:
authorWill Thompson <will.thompson@collabora.co.uk>2012-03-26 14:22:25 +0100
committerMatúš Kukan <matus.kukan@gmail.com>2012-07-17 16:40:00 +0200
commit70ecadfcffc780f5024c1ed99b18b7939ea0609f (patch)
tree1ab627d237239e041bac4024596b3ea81e7603de /tubes
parent114542a8b2d48b85721ba5699c5951810473f507 (diff)
tubes: quick hack to allow running two instances
To record a screencast, I wanted to get two instances of LibreOffice running in the same session. But the Client object(s) claim D-Bus names, so initializing the second instance failed. This patch changes things so that if LIBO_TUBES=master, no Client objects are created. As a result, only the slave can receive files.
Diffstat (limited to 'tubes')
-rw-r--r--tubes/inc/tubes/manager.hxx5
-rw-r--r--tubes/qa/test_manager.cxx4
-rw-r--r--tubes/source/manager.cxx10
3 files changed, 12 insertions, 7 deletions
diff --git a/tubes/inc/tubes/manager.hxx b/tubes/inc/tubes/manager.hxx
index ec85d9134506..c75e3c123e84 100644
--- a/tubes/inc/tubes/manager.hxx
+++ b/tubes/inc/tubes/manager.hxx
@@ -77,10 +77,10 @@ public:
Whether to create and iterate an own GMainLoop. For testing
purposes when no GMainLoop is available.
*/
- TeleManager( bool bCreateOwnGMainLoop = false );
+ TeleManager( bool bAcceptIncoming = true, bool bCreateOwnGMainLoop = false );
~TeleManager();
- static TeleManager *get();
+ static TeleManager *get( bool bAcceptIncoming );
void unref();
/** Prepare the Telepathy Account Manager. Requires connect() to have succeeded.
@@ -223,6 +223,7 @@ public:
private:
TeleConferenceVector maConferences;
+ bool mbAcceptIncoming;
bool mbChannelReadyHandlerInvoked : 1;
static TeleManagerImpl* pImpl;
diff --git a/tubes/qa/test_manager.cxx b/tubes/qa/test_manager.cxx
index cb3136285b26..ae9b713da243 100644
--- a/tubes/qa/test_manager.cxx
+++ b/tubes/qa/test_manager.cxx
@@ -211,12 +211,12 @@ void TestTeleTubes::testContactList()
void TestTeleTubes::testSetupManager1()
{
- mpManager1 = new TeleManager( true);
+ mpManager1 = new TeleManager( true, true);
}
void TestTeleTubes::testSetupManager2()
{
- mpManager2 = new TeleManager();
+ mpManager2 = new TeleManager( true );
}
void TestTeleTubes::testPrepareAccountManager1()
diff --git a/tubes/source/manager.cxx b/tubes/source/manager.cxx
index b9f9744c2f0f..21d0d4186349 100644
--- a/tubes/source/manager.cxx
+++ b/tubes/source/manager.cxx
@@ -357,8 +357,9 @@ static void TeleManager_AccountManagerReadyHandler(
}
-TeleManager::TeleManager( bool bCreateOwnGMainLoop )
+TeleManager::TeleManager( bool bAcceptIncoming, bool bCreateOwnGMainLoop )
:
+ mbAcceptIncoming( bAcceptIncoming ),
mbChannelReadyHandlerInvoked( false)
{
// The glib object types need to be initialized, else we aren't going
@@ -390,11 +391,11 @@ TeleManager::~TeleManager()
}
TeleManager *
-TeleManager::get()
+TeleManager::get( bool bAcceptIncoming )
{
MutexGuard aGuard( GetAnotherMutex());
if (!pSingleton)
- pSingleton = new TeleManager();
+ pSingleton = new TeleManager(bAcceptIncoming);
nAnotherRefCount++;
return pSingleton;
@@ -446,6 +447,9 @@ bool TeleManager::connect()
pImpl->mpContactList = new ContactList(pAccountManager);
+ if (!mbAcceptIncoming)
+ return true;
+
pImpl->mpClient = tp_simple_handler_new_with_factory(
TP_SIMPLE_CLIENT_FACTORY (pFactory), // factory
FALSE, // bypass_approval