From 9635473089accaa52a98242964cda0580a7f820d Mon Sep 17 00:00:00 2001 From: Jonny Lamb Date: Wed, 9 Nov 2011 10:54:03 +0000 Subject: [PATCH] client-factory: stop creating EmpathyTpFile objects TpAutomaticClientFactory will create TpFileTransferChannels for us and they're, like, way better. Signed-off-by: Jonny Lamb --- libempathy/empathy-client-factory.c | 6 ------ libempathy/empathy-ft-factory.c | 2 +- nautilus-sendto-plugin/empathy-nautilus-sendto.c | 3 +-- src/empathy-event-manager.c | 7 +++---- src/empathy-ft-manager.c | 5 ++--- 5 files changed, 7 insertions(+), 16 deletions(-) diff --git a/libempathy/empathy-client-factory.c b/libempathy/empathy-client-factory.c index f7529bf2..3794ef60 100644 --- a/libempathy/empathy-client-factory.c +++ b/libempathy/empathy-client-factory.c @@ -24,7 +24,6 @@ #include "empathy-client-factory.h" #include "empathy-tp-chat.h" -#include "empathy-tp-file.h" #include "empathy-utils.h" #include @@ -89,11 +88,6 @@ empathy_client_factory_create_channel (TpSimpleClientFactory *factory, return TP_CHANNEL (call_channel_new_with_factory ( TP_SIMPLE_CLIENT_FACTORY (factory), conn, path, properties, error)); } - else if (!tp_strdiff (chan_type, TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER)) - { - return TP_CHANNEL (empathy_tp_file_new ( - TP_SIMPLE_CLIENT_FACTORY (factory), conn, path, properties, error)); - } return chainup->create_channel (factory, conn, path, properties, error); } diff --git a/libempathy/empathy-ft-factory.c b/libempathy/empathy-ft-factory.c index fa52ce1a..10c8bea0 100644 --- a/libempathy/empathy-ft-factory.c +++ b/libempathy/empathy-ft-factory.c @@ -182,7 +182,7 @@ handle_channels_cb (TpSimpleHandler *handler, if (tp_proxy_get_invalidated (channel) != NULL) continue; - if (!EMPATHY_IS_TP_FILE (channel)) + if (!TP_IS_FILE_TRANSFER_CHANNEL (channel)) continue; /* We handle only incoming FT */ diff --git a/nautilus-sendto-plugin/empathy-nautilus-sendto.c b/nautilus-sendto-plugin/empathy-nautilus-sendto.c index 2f38b832..ee1519de 100644 --- a/nautilus-sendto-plugin/empathy-nautilus-sendto.c +++ b/nautilus-sendto-plugin/empathy-nautilus-sendto.c @@ -33,7 +33,6 @@ #include #include #include -#include #include #include @@ -166,7 +165,7 @@ quit (void) static void transfer_done_cb (EmpathyFTHandler *handler, - EmpathyTpFile *tp_file, + TpFileTransferChannel *channel, NstPlugin *plugin) { quit (); diff --git a/src/empathy-event-manager.c b/src/empathy-event-manager.c index da677d42..c42b8282 100644 --- a/src/empathy-event-manager.c +++ b/src/empathy-event-manager.c @@ -36,7 +36,6 @@ #include #include #include -#include #include #include @@ -422,9 +421,9 @@ reject_channel_claim_cb (GObject *source, { empathy_tp_chat_leave (user_data, ""); } - else if (EMPATHY_IS_TP_FILE (user_data)) + else if (TP_IS_FILE_TRANSFER_CHANNEL (user_data)) { - empathy_tp_file_close (user_data); + tp_channel_close_async (user_data, NULL, NULL); } out: @@ -1115,7 +1114,7 @@ approve_channels (TpSimpleApprover *approver, event_manager_call_channel_got_contact_cb, approval, NULL, G_OBJECT (self)); } - else if (EMPATHY_IS_TP_FILE (channel)) + else if (channel_type == TP_IFACE_QUARK_CHANNEL_TYPE_FILE_TRANSFER) { TpHandle handle; diff --git a/src/empathy-ft-manager.c b/src/empathy-ft-manager.c index 5d2f659f..bc15262a 100644 --- a/src/empathy-ft-manager.c +++ b/src/empathy-ft-manager.c @@ -37,7 +37,6 @@ #define DEBUG_FLAG EMPATHY_DEBUG_FT #include -#include #include #include @@ -518,7 +517,7 @@ do_real_transfer_done (EmpathyFTManager *manager, static void ft_handler_transfer_done_cb (EmpathyFTHandler *handler, - EmpathyTpFile *tp_file, + TpFileTransferChannel *channel, EmpathyFTManager *manager) { if (empathy_ft_handler_is_incoming (handler) && @@ -574,7 +573,7 @@ ft_handler_transfer_progress_cb (EmpathyFTHandler *handler, static void ft_handler_transfer_started_cb (EmpathyFTHandler *handler, - EmpathyTpFile *tp_file, + TpFileTransferChannel *channel, EmpathyFTManager *manager) { guint64 transferred_bytes, total_bytes; -- 2.39.2