diff options
author | Will Thompson <will.thompson@collabora.co.uk> | 2012-03-22 12:43:59 +0000 |
---|---|---|
committer | Matúš Kukan <matus.kukan@gmail.com> | 2012-07-17 16:39:31 +0200 |
commit | 813b650dfbbc85efebe0dca903aa285d48237b85 (patch) | |
tree | 0e68dd836ca38227f0b7d9c2ba03dd7b9041dc29 /tubes | |
parent | c6aa7e8aab81d27e0f8d1bcca82fa86d8f32d736 (diff) |
tubes test: store OString identifiers
This will prevent having to convert them in multiple places.
Diffstat (limited to 'tubes')
-rw-r--r-- | tubes/inc/tubes/manager.hxx | 2 | ||||
-rw-r--r-- | tubes/qa/test_manager.cxx | 17 | ||||
-rw-r--r-- | tubes/source/manager.cxx | 9 |
3 files changed, 16 insertions, 12 deletions
diff --git a/tubes/inc/tubes/manager.hxx b/tubes/inc/tubes/manager.hxx index 122b959611c3..c704780d2763 100644 --- a/tubes/inc/tubes/manager.hxx +++ b/tubes/inc/tubes/manager.hxx @@ -113,7 +113,7 @@ public: @param rBuddy The buddy to be connected. Must be a contact of rAccount. */ - bool startBuddySession( TpAccount *pAccount, const rtl::OUString& rBuddy ); + bool startBuddySession( TpAccount *pAccount, const rtl::OString& rBuddy ); void unregisterConference( TeleConferencePtr pConference ); diff --git a/tubes/qa/test_manager.cxx b/tubes/qa/test_manager.cxx index ea5806d83a89..da1b3ec88b01 100644 --- a/tubes/qa/test_manager.cxx +++ b/tubes/qa/test_manager.cxx @@ -91,8 +91,8 @@ private: rtl::OUString maTestConfigIniURL; rtl::Bootstrap maTestConfig; - rtl::OUString maAcc1; - rtl::OUString maAcc2; + rtl::OString maOffererIdentifier; + rtl::OString maAccepterIdentifier; }; // static, not members, so they actually survive cppunit test iteration @@ -107,10 +107,15 @@ TestTeleTubes::TestTeleTubes() { TeleManager::addSuffixToNames( "TeleTest"); + rtl::OUString aOffererIdentifier; CPPUNIT_ASSERT_MESSAGE( "See README for how to set up test-config.ini", - maTestConfig.getFrom("offerer", maAcc1)); + maTestConfig.getFrom("offerer", aOffererIdentifier)); + maOffererIdentifier = OUStringToOString( aOffererIdentifier, RTL_TEXTENCODING_UTF8); + + rtl::OUString aAccepterIdentifier; CPPUNIT_ASSERT_MESSAGE( "See README for how to set up test-config.ini", - maTestConfig.getFrom("accepter", maAcc2)); + maTestConfig.getFrom("accepter", aAccepterIdentifier)); + maAccepterIdentifier = OUStringToOString( aAccepterIdentifier, RTL_TEXTENCODING_UTF8); } TestTeleTubes::~TestTeleTubes() @@ -194,9 +199,9 @@ void TestTeleTubes::testPrepareAccountManager2() void TestTeleTubes::testStartBuddySession1() { - TpAccount *pAcc1 = mpManager1->getAccount( OUStringToOString( maAcc1, RTL_TEXTENCODING_UTF8)); + TpAccount *pAcc1 = mpManager1->getAccount(maOffererIdentifier); CPPUNIT_ASSERT ( pAcc1 != 0); - bool bStarted = mpManager1->startBuddySession( pAcc1, maAcc2); + bool bStarted = mpManager1->startBuddySession( pAcc1, maAccepterIdentifier); CPPUNIT_ASSERT( bStarted == true); } diff --git a/tubes/source/manager.cxx b/tubes/source/manager.cxx index 2e1c696a8ca1..96c4b3e30572 100644 --- a/tubes/source/manager.cxx +++ b/tubes/source/manager.cxx @@ -392,7 +392,7 @@ bool TeleManager::startGroupSession( const rtl::OUString& rUConferenceRoom, cons /* TODO: factor out common code with startGroupSession() */ -bool TeleManager::startBuddySession( TpAccount *pAccount, const rtl::OUString& rBuddy ) +bool TeleManager::startBuddySession( TpAccount *pAccount, const rtl::OString& rBuddy ) { INFO_LOGGER( "TeleManager::startBuddySession"); @@ -405,16 +405,15 @@ bool TeleManager::startBuddySession( TpAccount *pAccount, const rtl::OUString& r /* TODO: associate the document with this session and conference */ - OString aTarget( OUStringToOString( rBuddy, RTL_TEXTENCODING_UTF8)); - pConference->setTarget( aTarget); + pConference->setTarget( rBuddy); SAL_INFO( "tubes", "TeleManager::startBuddySession: creating channel request from " - << tp_account_get_path_suffix( pAccount) << " to " << aTarget.getStr()); + << tp_account_get_path_suffix( pAccount) << " to " << rBuddy.getStr()); GHashTable* pRequest = tp_asv_new( TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_DBUS_TUBE, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, TP_TYPE_HANDLE, TP_HANDLE_TYPE_CONTACT, - TP_PROP_CHANNEL_TARGET_ID, G_TYPE_STRING, aTarget.getStr(), + TP_PROP_CHANNEL_TARGET_ID, G_TYPE_STRING, rBuddy.getStr(), TP_PROP_CHANNEL_TYPE_DBUS_TUBE_SERVICE_NAME, G_TYPE_STRING, getFullServiceName().getStr(), NULL); |