diff options
author | Matúš Kukan <matus.kukan@gmail.com> | 2012-08-15 14:50:03 +0200 |
---|---|---|
committer | Matúš Kukan <matus.kukan@gmail.com> | 2012-08-16 11:41:51 +0200 |
commit | ece8eadbc0ba433c85c313eb11f0233aeae24cb9 (patch) | |
tree | d99bd75cb1db46d02986673edfd66cb4d7d0d4a0 /tubes/source | |
parent | 766a0247fc3ac49b25aab69948e4d0a5df334ff9 (diff) |
tubes: fix unittest again and simplify
- killed GMailLoop, seems to work with g_main_context_iteration( NULL, TRUE);
- added test for sending and also receiving file
Change-Id: Ida11f875709dab71d404697e8c39fe4548f653b0
Diffstat (limited to 'tubes/source')
-rw-r--r-- | tubes/source/contacts.cxx | 3 | ||||
-rw-r--r-- | tubes/source/manager.cxx | 43 |
2 files changed, 8 insertions, 38 deletions
diff --git a/tubes/source/contacts.cxx b/tubes/source/contacts.cxx index 2a75f2350ff0..5a46248129ce 100644 --- a/tubes/source/contacts.cxx +++ b/tubes/source/contacts.cxx @@ -230,6 +230,9 @@ public: // FIXME: ref the TpAccount, TpContact ... maACs.push_back( AccountContactPair( it->first, it->second ) ); pEntry->SetUserData( &maACs.back() ); + + g_object_unref (it->first); + g_object_unref (it->second); } } Show(); diff --git a/tubes/source/manager.cxx b/tubes/source/manager.cxx index de87a5212092..f1548c5e3d38 100644 --- a/tubes/source/manager.cxx +++ b/tubes/source/manager.cxx @@ -266,6 +266,10 @@ void TeleManager_fileReceived( const OUString& rStr, const OString& rUuid ) css::uno::Reference< css::lang::XMultiServiceFactory > rFactory = ::comphelper::getProcessServiceFactory(); + // Should happen only for unit test + if (rFactory == NULL) + return; + css::uno::Sequence < css::beans::PropertyValue > args(0); try { @@ -336,6 +340,7 @@ static void lcl_IncomingHandlerReady ( g_signal_connect( pHandler, "transfer-done", G_CALLBACK (TeleManager_TransferDone), NULL); g_signal_connect( pHandler, "transfer-error", G_CALLBACK (TeleManager_TransferError), NULL); + SAL_INFO ("tubes", "lcl_IncomingHandlerReady: starting file transfer.."); empathy_ft_handler_start_transfer( pHandler); } @@ -777,47 +782,11 @@ ContactList* TeleManager::getContactList() return pImpl->mpContactList; } -TpAccount* TeleManager::getAccount( const rtl::OString& rAccountID ) -{ - INFO_LOGGER_F( "TeleManager::getMyAccount"); - - SAL_WARN_IF( !pImpl->mbAccountManagerReady, "tubes", - "TeleManager::getMyAccount: Account Manager not prepared"); - if (!pImpl->mbAccountManagerReady) - return NULL; - - GList* pAccounts = tp_account_manager_get_valid_accounts( pImpl->mpAccountManager); - SAL_WARN_IF( !pAccounts, "tubes", "TeleManager::getMyAccount: no valid accounts"); - if (!pAccounts) - return NULL; - - // Find our account to use. - TpAccount* pAccount = NULL; - for (GList* pA = pAccounts; pA; pA = pA->next) - { - TpAccount* pAcc = TP_ACCOUNT( pA->data); - const gchar* pID = tp_account_get_normalized_name( pAcc); - if (pID && rAccountID == pID) - { - pAccount = pAcc; - break; // for - } - } - g_list_free( pAccounts); - - SAL_WARN_IF( !pAccount, "tubes", "TeleManager::getMyAccount: no account"); - if (!pAccount) - return NULL; - - return pAccount; -} - void TeleManager::setAccountManagerReady( bool bPrepared) { pImpl->mbAccountManagerReady = bPrepared; } - rtl::OString TeleManager::getFullClientName() { OStringBuffer aBuf(64); @@ -825,7 +794,6 @@ rtl::OString TeleManager::getFullClientName() return aBuf.makeStringAndClear(); } - rtl::OString TeleManager::getFullServiceName() { OStringBuffer aBuf(64); @@ -833,7 +801,6 @@ rtl::OString TeleManager::getFullServiceName() return aBuf.makeStringAndClear(); } - rtl::OString TeleManager::getFullObjectPath() { OStringBuffer aBuf(64); |