/soc/2013/ankitkv/gobjectification: 539b7b4d1949: Replaced purpl...

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


Changeset: 539b7b4d194933faa1ba61b9cb09c9c142f9f119
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2013-09-05 22:28 +0530
Branch:	 soc.2013.gobjectification
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/539b7b4d1949

Description:

Replaced purple_xfer_{ref|unref} with g_object_{ref|unref}

diffstat:

 finch/gntft.c                           |   4 ++--
 libpurple/protocols/jabber/si.c         |   6 +++---
 libpurple/protocols/msn/slp.c           |   8 ++++----
 libpurple/protocols/msn/slpcall.c       |   4 ++--
 libpurple/protocols/msn/slplink.c       |   6 +++---
 libpurple/protocols/mxit/filexfer.c     |   4 ++--
 libpurple/protocols/oscar/oscar.c       |   2 +-
 libpurple/protocols/oscar/peer.c        |   4 ++--
 libpurple/protocols/sametime/sametime.c |  10 +++++-----
 libpurple/protocols/silc/ft.c           |   4 ++--
 libpurple/xfer.c                        |  30 +++++++++++++++---------------
 libpurple/xfer.h                        |   2 +-
 pidgin/gtkft.c                          |   4 ++--
 13 files changed, 44 insertions(+), 44 deletions(-)

diffs (truncated from 394 to 300 lines):

diff --git a/finch/gntft.c b/finch/gntft.c
--- a/finch/gntft.c
+++ b/finch/gntft.c
@@ -297,7 +297,7 @@ finch_xfer_dialog_add_xfer(PurpleXfer *x
 	g_return_if_fail(xfer_dialog != NULL);
 	g_return_if_fail(xfer != NULL);
 
-	purple_xfer_ref(xfer);
+	g_object_ref(xfer);
 
 	data = purple_xfer_get_ui_data(xfer);
 	data->in_list = TRUE;
@@ -355,7 +355,7 @@ finch_xfer_dialog_remove_xfer(PurpleXfer
 		finch_xfer_dialog_destroy();
 	else
 		update_title_progress();
-	purple_xfer_unref(xfer);
+	g_object_unref(xfer);
 }
 
 void
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
@@ -830,11 +830,11 @@ jabber_si_xfer_bytestreams_listen_cb(int
 	/* I'm not sure under which conditions this can happen
 	 * (it seems like it shouldn't be possible */
 	if (purple_xfer_get_status(xfer) == PURPLE_XFER_STATUS_CANCEL_LOCAL) {
-		purple_xfer_unref(xfer);
+		g_object_unref(xfer);
 		return;
 	}
 
-	purple_xfer_unref(xfer);
+	g_object_unref(xfer);
 
 	iq = jabber_iq_new_query(jsx->js, JABBER_IQ_SET, NS_BYTESTREAMS);
 	xmlnode_set_attrib(iq->node, "to", purple_xfer_get_remote_user(xfer));
@@ -956,7 +956,7 @@ jabber_si_xfer_bytestreams_send_init(Pur
 	JabberSIXfer *jsx;
 	PurpleProxyType proxy_type;
 
-	purple_xfer_ref(xfer);
+	g_object_ref(xfer);
 
 	jsx = purple_xfer_get_protocol_data(xfer);
 
diff --git a/libpurple/protocols/msn/slp.c b/libpurple/protocols/msn/slp.c
--- a/libpurple/protocols/msn/slp.c
+++ b/libpurple/protocols/msn/slp.c
@@ -282,13 +282,13 @@ send_file_cb(MsnSlpCall *slpcall)
 	if (purple_xfer_get_status(xfer) >= PURPLE_XFER_STATUS_STARTED)
 		return;
 
-	purple_xfer_ref(xfer);
+	g_object_ref(xfer);
 	purple_xfer_start(xfer, -1, NULL, 0);
 	if (purple_xfer_get_status(xfer) != PURPLE_XFER_STATUS_STARTED) {
-		purple_xfer_unref(xfer);
+		g_object_unref(xfer);
 		return;
 	}
-	purple_xfer_unref(xfer);
+	g_object_unref(xfer);
 
 	slpmsg = msn_slpmsg_file_new(slpcall, purple_xfer_get_size(xfer));
 
@@ -385,7 +385,7 @@ msn_request_ft(PurpleXfer *xfer)
 	slpcall->end_cb = msn_xfer_end_cb;
 	slpcall->cb = msn_xfer_completed_cb;
 	slpcall->xfer = xfer;
-	purple_xfer_ref(slpcall->xfer);
+	g_object_ref(slpcall->xfer);
 
 	slpcall->pending = TRUE;
 
diff --git a/libpurple/protocols/msn/slpcall.c b/libpurple/protocols/msn/slpcall.c
--- a/libpurple/protocols/msn/slpcall.c
+++ b/libpurple/protocols/msn/slpcall.c
@@ -114,7 +114,7 @@ msn_slpcall_destroy(MsnSlpCall *slpcall)
 		if (purple_xfer_get_xfer_type(slpcall->xfer) == PURPLE_XFER_RECEIVE)
 			g_byte_array_free(slpcall->u.incoming_data, TRUE);
 		purple_xfer_set_protocol_data(slpcall->xfer, NULL);
-		purple_xfer_unref(slpcall->xfer);
+		g_object_unref(slpcall->xfer);
 	}
 
 
@@ -545,7 +545,7 @@ got_sessionreq(MsnSlpCall *slpcall, cons
 			slpcall->u.incoming_data = g_byte_array_new();
 
 			slpcall->xfer = xfer;
-			purple_xfer_ref(slpcall->xfer);
+			g_object_ref(slpcall->xfer);
 
 			purple_xfer_set_protocol_data(xfer, slpcall);
 
diff --git a/libpurple/protocols/msn/slplink.c b/libpurple/protocols/msn/slplink.c
--- a/libpurple/protocols/msn/slplink.c
+++ b/libpurple/protocols/msn/slplink.c
@@ -462,15 +462,15 @@ init_first_msg(MsnSlpLink *slplink, MsnP
 					slpmsg->ft = TRUE;
 					slpmsg->slpcall->xfer_msg = slpmsg;
 
-					purple_xfer_ref(xfer);
+					g_object_ref(xfer);
 					purple_xfer_start(xfer,	-1, NULL, 0);
 
 					if (purple_xfer_get_protocol_data(xfer) == NULL) {
-						purple_xfer_unref(xfer);
+						g_object_unref(xfer);
 						msn_slpmsg_destroy(slpmsg);
 						g_return_val_if_reached(NULL);
 					} else {
-						purple_xfer_unref(xfer);
+						g_object_unref(xfer);
 					}
 				}
 			}
diff --git a/libpurple/protocols/mxit/filexfer.c b/libpurple/protocols/mxit/filexfer.c
--- a/libpurple/protocols/mxit/filexfer.c
+++ b/libpurple/protocols/mxit/filexfer.c
@@ -440,11 +440,11 @@ void mxit_xfer_rx_file( struct MXitSessi
 	xfer = find_mxit_xfer( session, fileid );
 	if ( xfer ) {
 		/* this is the transfer we have been looking for */
-		purple_xfer_ref( xfer );
+		g_object_ref( xfer );
 		purple_xfer_start( xfer, -1, NULL, 0 );
 
 		if ( fwrite( data, datalen, 1, xfer->dest_fp ) > 0 ) {
-			purple_xfer_unref( xfer );
+			g_object_unref( xfer );
 			purple_xfer_set_completed( xfer, TRUE );
 			purple_xfer_end( xfer );
 
diff --git a/libpurple/protocols/oscar/oscar.c b/libpurple/protocols/oscar/oscar.c
--- a/libpurple/protocols/oscar/oscar.c
+++ b/libpurple/protocols/oscar/oscar.c
@@ -5239,7 +5239,7 @@ oscar_new_xfer(PurpleConnection *gc, con
 	xfer = purple_xfer_new(account, PURPLE_XFER_SEND, who);
 	if (xfer)
 	{
-		purple_xfer_ref(xfer);
+		g_object_ref(xfer);
 		purple_xfer_set_init_fnc(xfer, peer_oft_sendcb_init);
 		purple_xfer_set_cancel_send_fnc(xfer, peer_oft_cb_generic_cancel);
 		purple_xfer_set_request_denied_fnc(xfer, peer_oft_cb_generic_cancel);
diff --git a/libpurple/protocols/oscar/peer.c b/libpurple/protocols/oscar/peer.c
--- a/libpurple/protocols/oscar/peer.c
+++ b/libpurple/protocols/oscar/peer.c
@@ -224,7 +224,7 @@ peer_connection_destroy_cb(gpointer data
 			else
 				purple_xfer_cancel_local(conn->xfer);
 		}
-		purple_xfer_unref(conn->xfer);
+		g_object_unref(conn->xfer);
 		conn->xfer = NULL;
 	}
 
@@ -1114,7 +1114,7 @@ peer_connection_got_proposition(OscarDat
 		if (conn->xfer)
 		{
 			purple_xfer_set_protocol_data(conn->xfer, conn);
-			purple_xfer_ref(conn->xfer);
+			g_object_ref(conn->xfer);
 			purple_xfer_set_size(conn->xfer, args->info.sendfile.totsize);
 
 			/* Set the file name */
diff --git a/libpurple/protocols/sametime/sametime.c b/libpurple/protocols/sametime/sametime.c
--- a/libpurple/protocols/sametime/sametime.c
+++ b/libpurple/protocols/sametime/sametime.c
@@ -2191,8 +2191,8 @@ static void mw_ft_offered(struct mwFileT
   xfer = purple_xfer_new(acct, PURPLE_XFER_RECEIVE, who);
   if (xfer)
   {
-	purple_xfer_ref(xfer);
-	mwFileTransfer_setClientData(ft, xfer, (GDestroyNotify) purple_xfer_unref);
+	g_object_ref(xfer);
+	mwFileTransfer_setClientData(ft, xfer, (GDestroyNotify) g_object_unref);
 	purple_xfer_set_protocol_data(xfer, ft);
 
 	purple_xfer_set_init_fnc(xfer, ft_incoming_init);
@@ -2288,7 +2288,7 @@ static void mw_ft_closed(struct mwFileTr
       purple_xfer_cancel_remote(xfer);
 
       /* drop the stolen reference */
-      purple_xfer_unref(xfer);
+      g_object_unref(xfer);
       return;
     }
   }
@@ -5050,8 +5050,8 @@ static void ft_outgoing_init(PurpleXfer 
 
   ft = mwFileTransfer_new(srvc, &idb, NULL, filename, filesize);
 
-  purple_xfer_ref(xfer);
-  mwFileTransfer_setClientData(ft, xfer, (GDestroyNotify) purple_xfer_unref);
+  g_object_ref(xfer);
+  mwFileTransfer_setClientData(ft, xfer, (GDestroyNotify) g_object_unref);
   purple_xfer_set_protocol_data(xfer, ft);
 
   mwFileTransfer_offer(ft);
diff --git a/libpurple/protocols/silc/ft.c b/libpurple/protocols/silc/ft.c
--- a/libpurple/protocols/silc/ft.c
+++ b/libpurple/protocols/silc/ft.c
@@ -77,7 +77,7 @@ silcpurple_ftp_monitor(SilcClient client
 	if (status == SILC_CLIENT_FILE_MONITOR_CLOSED) {
 		/* All started sessions terminate here */
 		purple_xfer_set_protocol_data(xfer->xfer, NULL);
-		purple_xfer_unref(xfer->xfer);
+		g_object_unref(xfer->xfer);
 		silc_free(xfer);
 		return;
 	}
@@ -289,7 +289,7 @@ silcpurple_ftp_request_result(PurpleXfer
 	}
 
 	/* Error */
-	purple_xfer_unref(xfer->xfer);
+	g_object_unref(xfer->xfer);
 	g_free(xfer->hostname);
 	silc_free(xfer);
 	silc_free(local_ip);
diff --git a/libpurple/xfer.c b/libpurple/xfer.c
--- a/libpurple/xfer.c
+++ b/libpurple/xfer.c
@@ -240,7 +240,7 @@ purple_xfer_destroy(PurpleXfer *xfer)
 }
 
 void
-purple_xfer_ref(PurpleXfer *xfer)
+g_object_ref(PurpleXfer *xfer)
 {
 	g_return_if_fail(xfer != NULL);
 
@@ -251,7 +251,7 @@ purple_xfer_ref(PurpleXfer *xfer)
 }
 
 void
-purple_xfer_unref(PurpleXfer *xfer)
+g_object_unref(PurpleXfer *xfer)
 {
 	g_return_if_fail(xfer != NULL);
 	g_return_if_fail(xfer->ref > 0);
@@ -433,7 +433,7 @@ purple_xfer_choose_file_ok_cb(void *user
 			if (g_access(dir, mode) == 0) {
 				purple_xfer_request_accepted(xfer, filename);
 			} else {
-				purple_xfer_ref(xfer);
+				g_object_ref(xfer);
 				purple_notify_message(
 					NULL, PURPLE_NOTIFY_MSG_ERROR, NULL,
 					_("Directory is not writable."), NULL,
@@ -483,7 +483,7 @@ purple_xfer_choose_file_ok_cb(void *user
 		if (g_access(filename, mode) == 0) {
 			purple_xfer_request_accepted(xfer, filename);
 		} else {
-			purple_xfer_ref(xfer);
+			g_object_ref(xfer);
 			purple_notify_message(
 				NULL, PURPLE_NOTIFY_MSG_ERROR, NULL,
 				_("File is not readable."), NULL,
@@ -494,7 +494,7 @@ purple_xfer_choose_file_ok_cb(void *user
 		purple_xfer_request_accepted(xfer, filename);
 	}
 
-	purple_xfer_unref(xfer);
+	g_object_unref(xfer);
 }
 
 static void
@@ -507,7 +507,7 @@ purple_xfer_choose_file_cancel_cb(void *
 		purple_xfer_cancel_local(xfer);
 	else
 		purple_xfer_request_denied(xfer);
-	purple_xfer_unref(xfer);
+	g_object_unref(xfer);
 }
 
 static int
@@ -528,7 +528,7 @@ cancel_recv_cb(PurpleXfer *xfer)
 {
 	purple_xfer_set_status(xfer, PURPLE_XFER_STATUS_CANCEL_LOCAL);
 	purple_xfer_request_denied(xfer);
-	purple_xfer_unref(xfer);
+	g_object_unref(xfer);
 
 	return 0;
 }
@@ -595,7 +595,7 @@ static int
 ask_accept_cancel(PurpleXfer *xfer)
 {
 	purple_xfer_request_denied(xfer);
-	purple_xfer_unref(xfer);
+	g_object_unref(xfer);
 
 	return 0;
 }
@@ -630,7 +630,7 @@ purple_xfer_request(PurpleXfer *xfer)



More information about the Commits mailing list