/soc/2013/ankitkv/gobjectification: 1b74e5c63144: Use g_object_{...

Ankit Vani a at nevitus.org
Fri Sep 6 11:32:33 EDT 2013


Changeset: 1b74e5c631445799e9733795a05dfb882d0ee50e
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2013-09-06 20:04 +0530
Branch:	 soc.2013.gobjectification
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/1b74e5c63144

Description:

Use g_object_{ref|unref} instead of purple_roomlist_{ref|unref}

diffstat:

 finch/gntroomlist.c                   |   6 +++---
 libpurple/protocols/irc/irc.c         |   4 ++--
 libpurple/protocols/irc/msgs.c        |   2 +-
 libpurple/protocols/jabber/chat.c     |  12 ++++++------
 libpurple/protocols/silc/chat.c       |   4 ++--
 libpurple/protocols/silc/ops.c        |   6 +++---
 libpurple/protocols/yahoo/yahoochat.c |   6 +++---
 pidgin/gtkroomlist.c                  |  14 +++++++-------
 8 files changed, 27 insertions(+), 27 deletions(-)

diffs (253 lines):

diff --git a/finch/gntroomlist.c b/finch/gntroomlist.c
--- a/finch/gntroomlist.c
+++ b/finch/gntroomlist.c
@@ -68,7 +68,7 @@ unset_roomlist(gpointer null)
 {
 	froomlist.window = NULL;
 	if (froomlist.roomlist) {
-		purple_roomlist_unref(froomlist.roomlist);
+		g_object_unref(froomlist.roomlist);
 		froomlist.roomlist = NULL;
 	}
 	froomlist.account = NULL;
@@ -82,10 +82,10 @@ update_roomlist(PurpleRoomlist *list)
 		return;
 
 	if (froomlist.roomlist)
-		purple_roomlist_unref(froomlist.roomlist);
+		g_object_unref(froomlist.roomlist);
 
 	if ((froomlist.roomlist = list) != NULL)
-		purple_roomlist_ref(list);
+		g_object_ref(list);
 }
 
 static void fl_stop(GntWidget *button, gpointer null)
diff --git a/libpurple/protocols/irc/irc.c b/libpurple/protocols/irc/irc.c
--- a/libpurple/protocols/irc/irc.c
+++ b/libpurple/protocols/irc/irc.c
@@ -867,7 +867,7 @@ static PurpleRoomlist *irc_roomlist_get_
 	irc = purple_connection_get_protocol_data(gc);
 
 	if (irc->roomlist)
-		purple_roomlist_unref(irc->roomlist);
+		g_object_unref(irc->roomlist);
 
 	irc->roomlist = purple_roomlist_new(purple_connection_get_account(gc));
 
@@ -904,7 +904,7 @@ static void irc_roomlist_cancel(PurpleRo
 
 	if (irc->roomlist == list) {
 		irc->roomlist = NULL;
-		purple_roomlist_unref(list);
+		g_object_unref(list);
 	}
 }
 
diff --git a/libpurple/protocols/irc/msgs.c b/libpurple/protocols/irc/msgs.c
--- a/libpurple/protocols/irc/msgs.c
+++ b/libpurple/protocols/irc/msgs.c
@@ -540,7 +540,7 @@ void irc_msg_list(struct irc_conn *irc, 
 
 	if (!strcmp(name, "323")) {
 		purple_roomlist_set_in_progress(irc->roomlist, FALSE);
-		purple_roomlist_unref(irc->roomlist);
+		g_object_unref(irc->roomlist);
 		irc->roomlist = NULL;
 		return;
 	}
diff --git a/libpurple/protocols/jabber/chat.c b/libpurple/protocols/jabber/chat.c
--- a/libpurple/protocols/jabber/chat.c
+++ b/libpurple/protocols/jabber/chat.c
@@ -811,7 +811,7 @@ static void roomlist_disco_result_cb(Jab
 		purple_notify_error(js->gc, _("Error"),
 				_("Error retrieving room list"), err);
 		purple_roomlist_set_in_progress(js->roomlist, FALSE);
-		purple_roomlist_unref(js->roomlist);
+		g_object_unref(js->roomlist);
 		js->roomlist = NULL;
 		g_free(err);
 		return;
@@ -822,7 +822,7 @@ static void roomlist_disco_result_cb(Jab
 		purple_notify_error(js->gc, _("Error"),
 				_("Error retrieving room list"), err);
 		purple_roomlist_set_in_progress(js->roomlist, FALSE);
-		purple_roomlist_unref(js->roomlist);
+		g_object_unref(js->roomlist);
 		js->roomlist = NULL;
 		g_free(err);
 		return;
@@ -848,14 +848,14 @@ static void roomlist_disco_result_cb(Jab
 		jabber_id_free(jid);
 	}
 	purple_roomlist_set_in_progress(js->roomlist, FALSE);
-	purple_roomlist_unref(js->roomlist);
+	g_object_unref(js->roomlist);
 	js->roomlist = NULL;
 }
 
 static void roomlist_cancel_cb(JabberStream *js, const char *server) {
 	if(js->roomlist) {
 		purple_roomlist_set_in_progress(js->roomlist, FALSE);
-		purple_roomlist_unref(js->roomlist);
+		g_object_unref(js->roomlist);
 		js->roomlist = NULL;
 	}
 }
@@ -897,7 +897,7 @@ PurpleRoomlist *jabber_roomlist_get_list
 	PurpleRoomlistField *f;
 
 	if(js->roomlist)
-		purple_roomlist_unref(js->roomlist);
+		g_object_unref(js->roomlist);
 
 	js->roomlist = purple_roomlist_new(purple_connection_get_account(js->gc));
 
@@ -939,7 +939,7 @@ void jabber_roomlist_cancel(PurpleRoomli
 
 	if (js->roomlist == list) {
 		js->roomlist = NULL;
-		purple_roomlist_unref(list);
+		g_object_unref(list);
 	}
 }
 
diff --git a/libpurple/protocols/silc/chat.c b/libpurple/protocols/silc/chat.c
--- a/libpurple/protocols/silc/chat.c
+++ b/libpurple/protocols/silc/chat.c
@@ -1394,7 +1394,7 @@ PurpleRoomlist *silcpurple_roomlist_get_
 		return NULL;
 
 	if (sg->roomlist)
-		purple_roomlist_unref(sg->roomlist);
+		g_object_unref(sg->roomlist);
 
 	sg->roomlist_cancelled = FALSE;
 
@@ -1429,7 +1429,7 @@ void silcpurple_roomlist_cancel(PurpleRo
 
 	purple_roomlist_set_in_progress(list, FALSE);
 	if (sg->roomlist == list) {
-		purple_roomlist_unref(sg->roomlist);
+		g_object_unref(sg->roomlist);
 		sg->roomlist = NULL;
 		sg->roomlist_cancelled = TRUE;
 	}
diff --git a/libpurple/protocols/silc/ops.c b/libpurple/protocols/silc/ops.c
--- a/libpurple/protocols/silc/ops.c
+++ b/libpurple/protocols/silc/ops.c
@@ -1479,7 +1479,7 @@ silc_command_reply(SilcClient client, Si
 				purple_notify_error(gc, _("Error"), _("Error retrieving room list"),
 						    silc_get_status_message(error));
 				purple_roomlist_set_in_progress(sg->roomlist, FALSE);
-				purple_roomlist_unref(sg->roomlist);
+				g_object_unref(sg->roomlist);
 				sg->roomlist = NULL;
 				return;
 			}
@@ -1490,7 +1490,7 @@ silc_command_reply(SilcClient client, Si
 				purple_notify_error(gc, _("Roomlist"), _("Cannot get room list"),
 						    _("Network is empty"));
 				purple_roomlist_set_in_progress(sg->roomlist, FALSE);
-				purple_roomlist_unref(sg->roomlist);
+				g_object_unref(sg->roomlist);
 				sg->roomlist = NULL;
 				return;
 			}
@@ -1508,7 +1508,7 @@ silc_command_reply(SilcClient client, Si
 			if (status == SILC_STATUS_LIST_END ||
 			    status == SILC_STATUS_OK) {
 				purple_roomlist_set_in_progress(sg->roomlist, FALSE);
-				purple_roomlist_unref(sg->roomlist);
+				g_object_unref(sg->roomlist);
 				sg->roomlist = NULL;
 			}
 		}
diff --git a/libpurple/protocols/yahoo/yahoochat.c b/libpurple/protocols/yahoo/yahoochat.c
--- a/libpurple/protocols/yahoo/yahoochat.c
+++ b/libpurple/protocols/yahoo/yahoochat.c
@@ -1368,7 +1368,7 @@ static void yahoo_roomlist_cleanup(Purpl
 		yahoo_roomlist_destroy(yrl);
 	}
 
-	purple_roomlist_unref(list);
+	g_object_unref(list);
 }
 
 static void
@@ -1502,7 +1502,7 @@ void yahoo_roomlist_cancel(PurpleRoomlis
 
 	for (; l; l = l->next) {
 		yahoo_roomlist_destroy(l->data);
-		purple_roomlist_unref(list);
+		g_object_unref(list);
 	}
 	g_list_free(k);
 }
@@ -1553,5 +1553,5 @@ void yahoo_roomlist_expand_category(Purp
 
 	yahoo_roomlist_make_request(yrl);
 	purple_roomlist_set_in_progress(list, TRUE);
-	purple_roomlist_ref(list);
+	g_object_ref(list);
 }
diff --git a/pidgin/gtkroomlist.c b/pidgin/gtkroomlist.c
--- a/pidgin/gtkroomlist.c
+++ b/pidgin/gtkroomlist.c
@@ -95,11 +95,11 @@ static gint delete_win_cb(GtkWidget *w, 
 
 		if (dialog->pg_update_to > 0)
 			/* yes, that's right, unref it twice. */
-			purple_roomlist_unref(dialog->roomlist);
+			g_object_unref(dialog->roomlist);
 
 		if (rl)
 			rl->dialog = NULL;
-		purple_roomlist_unref(dialog->roomlist);
+		g_object_unref(dialog->roomlist);
 	}
 
 	dialog->progress = NULL;
@@ -120,7 +120,7 @@ static void dialog_select_account_cb(GOb
 			gtk_widget_destroy(rl->tree);
 			rl->tree = NULL;
 		}
-		purple_roomlist_unref(dialog->roomlist);
+		g_object_unref(dialog->roomlist);
 		dialog->roomlist = NULL;
 	}
 }
@@ -137,13 +137,13 @@ static void list_button_cb(GtkButton *bu
 	if (dialog->roomlist != NULL) {
 		rl = purple_roomlist_get_ui_data(dialog->roomlist);
 		gtk_widget_destroy(rl->tree);
-		purple_roomlist_unref(dialog->roomlist);
+		g_object_unref(dialog->roomlist);
 	}
 
 	dialog->roomlist = purple_roomlist_get_list(gc);
 	if (!dialog->roomlist)
 		return;
-	purple_roomlist_ref(dialog->roomlist);
+	g_object_ref(dialog->roomlist);
 	rl = purple_roomlist_get_ui_data(dialog->roomlist);
 	rl->dialog = dialog;
 
@@ -842,7 +842,7 @@ static gboolean pidgin_progress_bar_puls
 	if (!rl || !rl->dialog || !rl->dialog->pg_needs_pulse) {
 		if (rl && rl->dialog)
 			rl->dialog->pg_update_to = 0;
-		purple_roomlist_unref(list);
+		g_object_unref(list);
 		return FALSE;
 	}
 
@@ -867,7 +867,7 @@ static void pidgin_roomlist_add_room(Pur
 
 	if (rl->dialog) {
 		if (rl->dialog->pg_update_to == 0) {
-			purple_roomlist_ref(list);
+			g_object_ref(list);
 			rl->dialog->pg_update_to = g_timeout_add(100, pidgin_progress_bar_pulse, list);
 			gtk_progress_bar_pulse(GTK_PROGRESS_BAR(rl->dialog->progress));
 		} else



More information about the Commits mailing list