/soc/2013/ankitkv/gobjectification: 60502558e400: Replacements f...

Ankit Vani a at nevitus.org
Thu Sep 5 13:03:34 EDT 2013


Changeset: 60502558e4007909a82c4fb0040a7b957e80534c
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2013-09-05 21:59 +0530
Branch:	 soc.2013.gobjectification
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/60502558e400

Description:

Replacements for the GObject Xfer API

diffstat:

 finch/finch.c                              |   2 +-
 finch/gntblist.c                           |   2 +-
 finch/gntft.c                              |  10 +++++-----
 finch/gntft.h                              |   4 ++--
 finch/gntui.c                              |   2 +-
 libpurple/core.c                           |   2 +-
 libpurple/plugins/autoaccept.c             |   2 +-
 libpurple/plugins/signals-test.c           |   2 +-
 libpurple/protocols/bonjour/bonjour.c      |   2 +-
 libpurple/protocols/bonjour/bonjour_ft.c   |   8 ++++----
 libpurple/protocols/bonjour/jabber.c       |   2 +-
 libpurple/protocols/irc/dcc_send.c         |   2 +-
 libpurple/protocols/irc/irc.h              |   2 +-
 libpurple/protocols/jabber/oob.c           |   2 +-
 libpurple/protocols/jabber/si.c            |  20 ++++++++++----------
 libpurple/protocols/jabber/si.h            |   2 +-
 libpurple/protocols/msn/slp.h              |   2 +-
 libpurple/protocols/msn/slpcall.c          |   2 +-
 libpurple/protocols/msn/slplink.c          |   2 +-
 libpurple/protocols/msn/xfer.c             |   6 +++---
 libpurple/protocols/mxit/filexfer.c        |  16 ++++++++--------
 libpurple/protocols/oscar/oft.c            |   2 +-
 libpurple/protocols/oscar/peer.c           |   6 +++---
 libpurple/protocols/oscar/peer.h           |   2 +-
 libpurple/protocols/sametime/sametime.c    |   8 ++++----
 libpurple/protocols/silc/silcpurple.h      |   2 +-
 libpurple/protocols/yahoo/yahoo_filexfer.c |  10 +++++-----
 libpurple/protocols/yahoo/yahoo_filexfer.h |   2 +-
 libpurple/prpl.h                           |   2 +-
 libpurple/xfer.c                           |  30 +++++++++++++++---------------
 pidgin/gtkblist.c                          |   2 +-
 pidgin/gtkft.c                             |  14 +++++++-------
 pidgin/gtkft.h                             |   4 ++--
 pidgin/gtkmain.c                           |   4 ++--
 pidgin/plugins/perl/common/gtkmodule.h     |   4 ++--
 35 files changed, 93 insertions(+), 93 deletions(-)

diffs (truncated from 909 to 300 lines):

diff --git a/finch/finch.c b/finch/finch.c
--- a/finch/finch.c
+++ b/finch/finch.c
@@ -27,7 +27,7 @@
 #include "core.h"
 #include "debug.h"
 #include "eventloop.h"
-#include "ft.h"
+#include "xfer.h"
 #include "log.h"
 #include "notify.h"
 #include "prefs.h"
diff --git a/finch/gntblist.c b/finch/gntblist.c
--- a/finch/gntblist.c
+++ b/finch/gntblist.c
@@ -42,7 +42,7 @@
 #include "gntcolors.h"
 #include "gntcombobox.h"
 #include "gntentry.h"
-#include "gntft.h"
+#include "gntxfer.h"
 #include "gntlabel.h"
 #include "gntline.h"
 #include "gntlog.h"
diff --git a/finch/gntft.c b/finch/gntft.c
--- a/finch/gntft.c
+++ b/finch/gntft.c
@@ -35,11 +35,11 @@
 
 #include "debug.h"
 #include "notify.h"
-#include "ft.h"
+#include "xfer.h"
 #include "prpl.h"
 #include "util.h"
 
-#include "gntft.h"
+#include "gntxfer.h"
 #include "prefs.h"
 
 typedef struct
@@ -169,7 +169,7 @@ static void
 stop_button_cb(GntButton *button)
 {
 	PurpleXfer *selected_xfer = gnt_tree_get_selection_data(GNT_TREE(xfer_dialog->tree));
-	PurpleXferStatusType status;
+	PurpleXferStatus status;
 
 	if (!selected_xfer)
 		return;
@@ -306,7 +306,7 @@ finch_xfer_dialog_add_xfer(PurpleXfer *x
 
 	data->last_updated_time = 0;
 
-	type = purple_xfer_get_type(xfer);
+	type = purple_xfer_get_xfer_type(xfer);
 
 	size_str      = purple_str_size_to_units(purple_xfer_get_size(xfer));
 	remaining_str = purple_str_size_to_units(purple_xfer_get_bytes_remaining(xfer));
@@ -427,7 +427,7 @@ finch_xfer_dialog_update_xfer(PurpleXfer
 	}
 	data->last_updated_time = current_time;
 
-	send = (purple_xfer_get_type(xfer) == PURPLE_XFER_SEND);
+	send = (purple_xfer_get_xfer_type(xfer) == PURPLE_XFER_SEND);
 	size_str      = purple_str_size_to_units(purple_xfer_get_size(xfer));
 	remaining_str = purple_str_size_to_units(purple_xfer_get_bytes_remaining(xfer));
 	kbsec = g_strdup_printf(_("%.2f KiB/s"), kbps);
diff --git a/finch/gntft.h b/finch/gntft.h
--- a/finch/gntft.h
+++ b/finch/gntft.h
@@ -1,5 +1,5 @@
 /**
- * @file gntft.h GNT File Transfer UI
+ * @file gntxfer.h GNT File Transfer UI
  * @ingroup finch
  */
 
@@ -26,7 +26,7 @@
 #ifndef _FINCHFT_H_
 #define _FINCHFT_H_
 
-#include "ft.h"
+#include "xfer.h"
 
 
 /**************************************************************************/
diff --git a/finch/gntui.c b/finch/gntui.c
--- a/finch/gntui.c
+++ b/finch/gntui.c
@@ -30,7 +30,7 @@
 #include "gntconn.h"
 #include "gntconv.h"
 #include "gntdebug.h"
-#include "gntft.h"
+#include "gntxfer.h"
 #include "gntlog.h"
 #include "gntmedia.h"
 #include "gntnotify.h"
diff --git a/libpurple/core.c b/libpurple/core.c
--- a/libpurple/core.c
+++ b/libpurple/core.c
@@ -32,7 +32,7 @@
 #include "core.h"
 #include "debug.h"
 #include "dnsquery.h"
-#include "ft.h"
+#include "xfer.h"
 #include "glibcompat.h"
 #include "http.h"
 #include "idle.h"
diff --git a/libpurple/plugins/autoaccept.c b/libpurple/plugins/autoaccept.c
--- a/libpurple/plugins/autoaccept.c
+++ b/libpurple/plugins/autoaccept.c
@@ -36,7 +36,7 @@
 
 #include <buddylist.h>
 #include <conversation.h>
-#include <ft.h>
+#include <xfer.h>
 #include <request.h>
 #include <notify.h>
 #include <util.h>
diff --git a/libpurple/plugins/signals-test.c b/libpurple/plugins/signals-test.c
--- a/libpurple/plugins/signals-test.c
+++ b/libpurple/plugins/signals-test.c
@@ -28,7 +28,7 @@
 #include "conversation.h"
 #include "core.h"
 #include "debug.h"
-#include "ft.h"
+#include "xfer.h"
 #include "signals.h"
 #include "version.h"
 #include "status.h"
diff --git a/libpurple/protocols/bonjour/bonjour.c b/libpurple/protocols/bonjour/bonjour.c
--- a/libpurple/protocols/bonjour/bonjour.c
+++ b/libpurple/protocols/bonjour/bonjour.c
@@ -42,7 +42,7 @@
 #include "mdns_common.h"
 #include "jabber.h"
 #include "buddy.h"
-#include "bonjour_ft.h"
+#include "bonjour_xfer.h"
 
 static char *default_firstname;
 static char *default_lastname;
diff --git a/libpurple/protocols/bonjour/bonjour_ft.c b/libpurple/protocols/bonjour/bonjour_ft.c
--- a/libpurple/protocols/bonjour/bonjour_ft.c
+++ b/libpurple/protocols/bonjour/bonjour_ft.c
@@ -24,10 +24,10 @@
 #include "debug.h"
 #include "notify.h"
 #include "proxy.h"
-#include "ft.h"
+#include "xfer.h"
 #include "buddy.h"
 #include "bonjour.h"
-#include "bonjour_ft.h"
+#include "bonjour_xfer.h"
 #include "ciphers/sha1hash.h"
 
 static void
@@ -134,7 +134,7 @@ static void bonjour_xfer_end(PurpleXfer 
 
 	/* We can't allow the server side to close the connection until the client is complete,
 	 * otherwise there is a RST resulting in an error on the client side */
-	if (purple_xfer_get_type(xfer) == PURPLE_XFER_SEND && purple_xfer_is_completed(xfer)) {
+	if (purple_xfer_get_xfer_type(xfer) == PURPLE_XFER_SEND && purple_xfer_is_completed(xfer)) {
 		struct socket_cleanup *sc = g_new0(struct socket_cleanup, 1);
 		sc->fd = purple_xfer_get_fd(xfer);
 		purple_xfer_set_fd(xfer, -1);
@@ -416,7 +416,7 @@ bonjour_xfer_init(PurpleXfer *xfer)
 	/* Assume it is the first IP. We could do something like keep track of which one is in use or something. */
 	if (bb->ips)
 		xf->buddy_ip = g_strdup(bb->ips->data);
-	if (purple_xfer_get_type(xfer) == PURPLE_XFER_SEND) {
+	if (purple_xfer_get_xfer_type(xfer) == PURPLE_XFER_SEND) {
 		/* initiate file transfer, send SI offer. */
 		purple_debug_info("bonjour", "Bonjour xfer type is PURPLE_XFER_SEND.\n");
 		xep_ft_si_offer(xfer, purple_xfer_get_remote_user(xfer));
diff --git a/libpurple/protocols/bonjour/jabber.c b/libpurple/protocols/bonjour/jabber.c
--- a/libpurple/protocols/bonjour/jabber.c
+++ b/libpurple/protocols/bonjour/jabber.c
@@ -62,7 +62,7 @@
 #include "parser.h"
 #include "bonjour.h"
 #include "buddy.h"
-#include "bonjour_ft.h"
+#include "bonjour_xfer.h"
 
 #ifdef _SIZEOF_ADDR_IFREQ
 #  define HX_SIZE_OF_IFREQ(a) _SIZEOF_ADDR_IFREQ(a)
diff --git a/libpurple/protocols/irc/dcc_send.c b/libpurple/protocols/irc/dcc_send.c
--- a/libpurple/protocols/irc/dcc_send.c
+++ b/libpurple/protocols/irc/dcc_send.c
@@ -24,7 +24,7 @@
 #include "internal.h"
 #include "irc.h"
 #include "debug.h"
-#include "ft.h"
+#include "xfer.h"
 #include "notify.h"
 #include "network.h"
 
diff --git a/libpurple/protocols/irc/irc.h b/libpurple/protocols/irc/irc.h
--- a/libpurple/protocols/irc/irc.h
+++ b/libpurple/protocols/irc/irc.h
@@ -30,7 +30,7 @@
 #endif
 
 #include "circularbuffer.h"
-#include "ft.h"
+#include "xfer.h"
 #include "roomlist.h"
 #include "sslconn.h"
 
diff --git a/libpurple/protocols/jabber/oob.c b/libpurple/protocols/jabber/oob.c
--- a/libpurple/protocols/jabber/oob.c
+++ b/libpurple/protocols/jabber/oob.c
@@ -22,7 +22,7 @@
  */
 #include "internal.h"
 #include "debug.h"
-#include "ft.h"
+#include "xfer.h"
 #include "http.h"
 #include "util.h"
 
diff --git a/libpurple/protocols/jabber/si.c b/libpurple/protocols/jabber/si.c
--- a/libpurple/protocols/jabber/si.c
+++ b/libpurple/protocols/jabber/si.c
@@ -26,7 +26,7 @@
 
 #include "buddylist.h"
 #include "debug.h"
-#include "ft.h"
+#include "xfer.h"
 #include "request.h"
 #include "network.h"
 #include "notify.h"
@@ -143,7 +143,7 @@ jabber_si_bytestreams_connect_cb(gpointe
 	}
 
 	/* unknown file transfer type is assumed to be RECEIVE */
-	if(purple_xfer_get_type(xfer) == PURPLE_XFER_SEND)
+	if(purple_xfer_get_xfer_type(xfer) == PURPLE_XFER_SEND)
 	{
 		xmlnode *activate;
 		iq = jabber_iq_new_query(jsx->js, JABBER_IQ_SET, NS_BYTESTREAMS);
@@ -247,7 +247,7 @@ static void jabber_si_bytestreams_attemp
 			/* if we are the sender, open an IBB session, but not if we already
 			  did it, since we could have received the error <iq/> from the
 			  receiver already... */
-			if (purple_xfer_get_type(xfer) == PURPLE_XFER_SEND
+			if (purple_xfer_get_xfer_type(xfer) == PURPLE_XFER_SEND
 				&& !jsx->ibb_session) {
 				jabber_si_xfer_ibb_send_init(jsx->js, xfer);
 			} else {
@@ -293,7 +293,7 @@ static void jabber_si_bytestreams_attemp
 		purple_proxy_info_set_port(jsx->gpi, streamhost->port);
 
 		/* unknown file transfer type is assumed to be RECEIVE */
-		if(purple_xfer_get_type(xfer) == PURPLE_XFER_SEND)
+		if(purple_xfer_get_xfer_type(xfer) == PURPLE_XFER_SEND)
 			dstaddr = g_strdup_printf("%s%s@%s/%s%s@%s/%s", jsx->stream_id, jsx->js->user->node, jsx->js->user->domain,
 				jsx->js->user->resource, dstjid->node, dstjid->domain, dstjid->resource);
 		else
@@ -311,7 +311,7 @@ static void jabber_si_bytestreams_attemp
 		g_free(dstaddr);
 
 		/* When selecting a streamhost, timeout after STREAMHOST_CONNECT_TIMEOUT seconds, otherwise it takes forever */
-		if (purple_xfer_get_type(xfer) != PURPLE_XFER_SEND && jsx->connect_data != NULL)
+		if (purple_xfer_get_xfer_type(xfer) != PURPLE_XFER_SEND && jsx->connect_data != NULL)
 			jsx->connect_timeout = purple_timeout_add_seconds(
 				STREAMHOST_CONNECT_TIMEOUT, connect_timeout_cb, xfer);
 
@@ -734,7 +734,7 @@ jabber_si_connect_proxy_cb(JabberStream 
 			/* if we are the sender and haven't already opened an IBB
 			  session, do so now (we might already have failed to open
 			  the bytestream proxy ourselves when receiving this <iq/> */
-			if (purple_xfer_get_type(xfer) == PURPLE_XFER_SEND
+			if (purple_xfer_get_xfer_type(xfer) == PURPLE_XFER_SEND
 				&& !jsx->ibb_session) {
 				jabber_si_xfer_ibb_send_init(js, xfer);
 			} else {
@@ -776,7 +776,7 @@ jabber_si_connect_proxy_cb(JabberStream 
 			if (jsx->stream_method & STREAM_METHOD_IBB) {
 				purple_debug_info("jabber",
 					"jabber_si_connect_proxy_cb: trying to revert to IBB\n");
-				if (purple_xfer_get_type(xfer) == PURPLE_XFER_SEND) {
+				if (purple_xfer_get_xfer_type(xfer) == PURPLE_XFER_SEND) {
 					jabber_si_xfer_ibb_send_init(jsx->js, xfer);
 				} else {
 					jsx->ibb_timeout_handle = purple_timeout_add_seconds(30,
@@ -926,7 +926,7 @@ jabber_si_xfer_bytestreams_listen_cb(int
 		if (jsx->stream_method & STREAM_METHOD_IBB) {
 			purple_debug_info("jabber",
 				"jabber_si_xfer_bytestreams_listen_cb: trying to revert to IBB\n");
-			if (purple_xfer_get_type(xfer) == PURPLE_XFER_SEND) {



More information about the Commits mailing list