diff options
Diffstat (limited to 'tubes')
-rw-r--r-- | tubes/Package_inc.mk | 1 | ||||
-rw-r--r-- | tubes/inc/tubes/conference.hxx | 2 | ||||
-rw-r--r-- | tubes/inc/tubes/manager.hxx | 3 | ||||
-rw-r--r-- | tubes/source/conference.cxx | 18 | ||||
-rw-r--r-- | tubes/source/manager.cxx | 14 |
5 files changed, 18 insertions, 20 deletions
diff --git a/tubes/Package_inc.mk b/tubes/Package_inc.mk index a59ab3a0b085..71f75f7fe3cb 100644 --- a/tubes/Package_inc.mk +++ b/tubes/Package_inc.mk @@ -29,7 +29,6 @@ $(eval $(call gb_Package_Package,tubes_inc,$(SRCDIR)/tubes/inc)) $(eval $(call gb_Package_add_file,tubes_inc,inc/tubes/conference.hxx,tubes/conference.hxx)) $(eval $(call gb_Package_add_file,tubes_inc,inc/tubes/constants.h,tubes/constants.h)) $(eval $(call gb_Package_add_file,tubes_inc,inc/tubes/contact-list.hxx,tubes/contact-list.hxx)) -$(eval $(call gb_Package_add_file,tubes_inc,inc/tubes/file-transfer-helper.h,tubes/file-transfer-helper.h)) $(eval $(call gb_Package_add_file,tubes_inc,inc/tubes/manager.hxx,tubes/manager.hxx)) $(eval $(call gb_Package_add_file,tubes_inc,inc/tubes/tubesdllapi.h,tubes/tubesdllapi.h)) $(eval $(call gb_Package_add_file,tubes_inc,inc/tubes/warnings_guard_boost_signals2.hpp,tubes/warnings_guard_boost_signals2.hpp)) diff --git a/tubes/inc/tubes/conference.hxx b/tubes/inc/tubes/conference.hxx index 54638f2bc4e8..ab6db925b0fd 100644 --- a/tubes/inc/tubes/conference.hxx +++ b/tubes/inc/tubes/conference.hxx @@ -31,7 +31,6 @@ #include <sal/config.h> #include "tubes/tubesdllapi.h" -#include "tubes/file-transfer-helper.h" #include <rtl/ustring.hxx> #include <telepathy-glib/telepathy-glib.h> #include <queue> @@ -89,7 +88,6 @@ public: static void TubeOfferedHandler(GObject* pSource, GAsyncResult* pResult, gpointer pUserData); static void TubeAcceptedHandler(GObject* pSource, GAsyncResult* pResult, gpointer pUserData); - static void FTReady( EmpathyFTHandler *handler, GError *error, gpointer user_data); static void methodCallHandler(GDBusConnection* pConnection, const gchar* pSender, diff --git a/tubes/inc/tubes/manager.hxx b/tubes/inc/tubes/manager.hxx index d51154e54991..c8e7b4ae356e 100644 --- a/tubes/inc/tubes/manager.hxx +++ b/tubes/inc/tubes/manager.hxx @@ -134,6 +134,7 @@ public: /** True if there has been tube channel received and is still not used. */ TUBES_DLLPUBLIC static bool hasWaitingConference(); + static void setCurrentUuid( const OString& rUuid ); void disconnect(); @@ -192,8 +193,6 @@ public: TpAccount* getAccount( const rtl::OString& rAccountID ); /* Callbacks; not for use outside this class. */ - static void TransferDone( EmpathyFTHandler *handler, TpFileTransferChannel *, gpointer user_data); - static void DBusChannelHandler( TpSimpleHandler* /*handler*/, TpAccount* pAccount, diff --git a/tubes/source/conference.cxx b/tubes/source/conference.cxx index fde936892df7..5cf197251601 100644 --- a/tubes/source/conference.cxx +++ b/tubes/source/conference.cxx @@ -29,7 +29,7 @@ #include <tubes/conference.hxx> #include <tubes/manager.hxx> #include <tubes/constants.h> - +#include <tubes/file-transfer-helper.h> #if defined SAL_LOG_INFO namespace @@ -439,14 +439,10 @@ void TeleConference::invite( TpContact *pContact ) class SendFileRequest { public: - SendFileRequest( TeleConference *pSelf, - TeleConference::FileSentCallback pCallback, void* pUserData) - : mpSelf(pSelf) - , mpCallback(pCallback) + SendFileRequest( TeleConference::FileSentCallback pCallback, void* pUserData) + : mpCallback(pCallback) , mpUserData(pUserData) {}; - /* FIXME: make a shared pointer? */ - TeleConference* mpSelf; TeleConference::FileSentCallback mpCallback; void* mpUserData; }; @@ -471,7 +467,7 @@ static void TeleConference_TransferError( EmpathyFTHandler *handler, const GErro g_object_unref (handler); } -void TeleConference::FTReady( EmpathyFTHandler *handler, GError *error, gpointer user_data) +static void TeleConference_FTReady( EmpathyFTHandler *handler, GError *error, gpointer user_data) { SendFileRequest *request = reinterpret_cast<SendFileRequest *>(user_data); @@ -487,7 +483,7 @@ void TeleConference::FTReady( EmpathyFTHandler *handler, GError *error, gpointer G_CALLBACK (TeleConference_TransferDone), request); g_signal_connect(handler, "transfer-error", G_CALLBACK (TeleConference_TransferError), request); - empathy_ft_handler_set_service_name(handler, request->mpSelf->mpManager->getFullServiceName().getStr()); + empathy_ft_handler_set_service_name(handler, TeleManager::getFullServiceName().getStr()); empathy_ft_handler_start_transfer(handler); } } @@ -504,13 +500,13 @@ void TeleConference::sendFile( rtl::OUString &localUri, FileSentCallback pCallba GFile *pSource = g_file_new_for_uri( OUStringToOString( localUri, RTL_TEXTENCODING_UTF8).getStr() ); - SendFileRequest *pReq = new SendFileRequest( this, pCallback, pUserData); + SendFileRequest *pReq = new SendFileRequest( pCallback, pUserData); empathy_ft_handler_new_outgoing( mpAccount, tp_channel_get_target_contact( TP_CHANNEL( mpChannel)), pSource, 0, - &TeleConference::FTReady, pReq); + TeleConference_FTReady, pReq); } diff --git a/tubes/source/manager.cxx b/tubes/source/manager.cxx index 768492b76b04..c771727ab258 100644 --- a/tubes/source/manager.cxx +++ b/tubes/source/manager.cxx @@ -28,6 +28,7 @@ #include "tubes/manager.hxx" #include "tubes/constants.h" +#include "tubes/file-transfer-helper.h" #include <com/sun/star/uno/Sequence.hxx> #include <com/sun/star/frame/XComponentLoader.hpp> @@ -180,6 +181,11 @@ bool TeleManager::hasWaitingConference() return !pImpl->msCurrentUUID.isEmpty(); } +void TeleManager::setCurrentUuid( const OString& rUuid ) +{ + pImpl->msCurrentUUID = rUuid; +} + // FIXME this is exported only because of ScDocFuncDemo SAL_DLLPUBLIC_EXPORT void TeleManager_fileReceived( const rtl::OUString &rStr ) { @@ -205,9 +211,9 @@ SAL_DLLPUBLIC_EXPORT void TeleManager_fileReceived( const rtl::OUString &rStr ) } } -void TeleManager::TransferDone( EmpathyFTHandler *handler, TpFileTransferChannel *, gpointer ) +void TeleManager_TransferDone( EmpathyFTHandler *handler, TpFileTransferChannel *, gpointer ) { - SAL_INFO( "tubes", "TeleManager::TransferDone: hooray!"); + SAL_INFO( "tubes", "TeleManager_TransferDone: hooray!"); GFile *gfile = empathy_ft_handler_get_gfile( handler); char *uri = g_file_get_uri( gfile); rtl::OUString aUri( uri, strlen( uri), RTL_TEXTENCODING_UTF8); @@ -217,7 +223,7 @@ void TeleManager::TransferDone( EmpathyFTHandler *handler, TpFileTransferChannel sal_Int32 last = aUri.lastIndexOf('_'); OString sUuid( OUStringToOString( aUri.copy( first + 1, last - first - 1), RTL_TEXTENCODING_UTF8)); - pImpl->msCurrentUUID = sUuid; + TeleManager::setCurrentUuid( sUuid ); TeleManager_fileReceived( aUri ); g_object_unref( handler); @@ -256,7 +262,7 @@ TeleManager_IncomingHandlerReady ( empathy_ft_handler_incoming_set_destination( pHandler, pDestination); g_object_unref( pDestination); - g_signal_connect( pHandler, "transfer-done", G_CALLBACK (&TeleManager::TransferDone), pManager); + g_signal_connect( pHandler, "transfer-done", G_CALLBACK (TeleManager_TransferDone), pManager); g_signal_connect( pHandler, "transfer-error", G_CALLBACK (TeleManager_TransferError), pManager); empathy_ft_handler_start_transfer( pHandler); } |