changeset 26705:a3f7ade9e45b

Use g_object_ref/unref instead of the deprecated versions.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Sat, 18 Apr 2009 07:31:32 +0000
parents 9641c73e7f2d
children 4aa5400b1b99
files pidgin/gtkaccount.c pidgin/gtkdialogs.c pidgin/gtkprefs.c pidgin/gtksmiley.c pidgin/gtkstatusbox.c pidgin/gtkutils.c pidgin/gtkwhiteboard.c pidgin/plugins/markerline.c
diffstat 8 files changed, 22 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtkaccount.c	Sat Apr 18 07:00:20 2009 +0000
+++ b/pidgin/gtkaccount.c	Sat Apr 18 07:31:32 2009 +0000
@@ -413,7 +413,11 @@
 
 	if (dialog->protocol_menu != NULL)
 	{
+#if GTK_CHECK_VERSION(2,12,0)
+		g_object_ref(G_OBJECT(dialog->protocol_menu));
+#else
 		gtk_widget_ref(dialog->protocol_menu);
+#endif
 		hbox = g_object_get_data(G_OBJECT(dialog->protocol_menu), "container");
 		gtk_container_remove(GTK_CONTAINER(hbox), dialog->protocol_menu);
 	}
@@ -440,13 +444,21 @@
 	{
 		dialog->protocol_menu = pidgin_protocol_option_menu_new(
 				dialog->protocol_id, G_CALLBACK(set_account_protocol_cb), dialog);
+#if GTK_CHECK_VERSION(2,12,0)
+		g_object_ref(G_OBJECT(dialog->protocol_menu));
+#else
 		gtk_widget_ref(dialog->protocol_menu);
+#endif
 	}
 
 	hbox = add_pref_box(dialog, vbox, _("Pro_tocol:"), dialog->protocol_menu);
 	g_object_set_data(G_OBJECT(dialog->protocol_menu), "container", hbox);
 
+#if GTK_CHECK_VERSION(2,12,0)
+	g_object_unref(G_OBJECT(dialog->protocol_menu));
+#else
 	gtk_widget_unref(dialog->protocol_menu);
+#endif
 
 	/* Username */
 	dialog->username_entry = gtk_entry_new();
--- a/pidgin/gtkdialogs.c	Sat Apr 18 07:00:20 2009 +0000
+++ b/pidgin/gtkdialogs.c	Sat Apr 18 07:31:32 2009 +0000
@@ -427,7 +427,7 @@
 #endif
 	gtk_widget_destroy(logo);
 	logo = gtk_image_new_from_pixbuf(pixbuf);
-	gdk_pixbuf_unref(pixbuf);
+	g_object_unref(G_OBJECT(pixbuf));
 	/* Insert the logo */
 	obj = gtk_widget_get_accessible(logo);
 	tmp = g_strconcat(PIDGIN_NAME, " " DISPLAY_VERSION, NULL);
--- a/pidgin/gtkprefs.c	Sat Apr 18 07:00:20 2009 +0000
+++ b/pidgin/gtkprefs.c	Sat Apr 18 07:31:32 2009 +0000
@@ -638,7 +638,7 @@
 		gtk_list_store_set(prefs_sound_themes, &iter, 0, pixbuf, 2, purple_theme_get_name(theme), -1);
 
 		if (pixbuf != NULL)
-			gdk_pixbuf_unref(pixbuf);
+			g_object_unref(G_OBJECT(pixbuf));
 
 	} else if (PIDGIN_IS_BLIST_THEME(theme) || PIDGIN_IS_STATUS_ICON_THEME(theme)){
 		GtkListStore *store;
@@ -665,7 +665,7 @@
 
 		g_free(markup);
 		if (pixbuf != NULL)
-			gdk_pixbuf_unref(pixbuf);
+			g_object_unref(G_OBJECT(pixbuf));
 	}
 
 }
--- a/pidgin/gtksmiley.c	Sat Apr 18 07:00:20 2009 +0000
+++ b/pidgin/gtksmiley.c	Sat Apr 18 07:31:32 2009 +0000
@@ -74,7 +74,7 @@
 	gtk_widget_destroy(smiley->parent);
 	g_free(smiley->filename);
 	if (smiley->custom_pixbuf)
-		gdk_pixbuf_unref(smiley->custom_pixbuf);
+		g_object_unref(G_OBJECT(smiley->custom_pixbuf));
 	g_free(smiley);
 }
 
@@ -460,7 +460,7 @@
 {
 	if (editor->custom_pixbuf)
 		gdk_pixbuf_unref(editor->custom_pixbuf);
-	editor->custom_pixbuf = image ? gdk_pixbuf_ref(image) : NULL;
+	editor->custom_pixbuf = image ? g_object_ref(G_OBJECT(image)) : NULL;
 	if (image)
 		gtk_image_set_from_pixbuf(GTK_IMAGE(editor->smiley_image), image);
 }
--- a/pidgin/gtkstatusbox.c	Sat Apr 18 07:00:20 2009 +0000
+++ b/pidgin/gtkstatusbox.c	Sat Apr 18 07:31:32 2009 +0000
@@ -536,12 +536,12 @@
 
 	for (i = 0; i < G_N_ELEMENTS(statusbox->connecting_pixbufs); i++) {
 		if (statusbox->connecting_pixbufs[i] != NULL)
-			gdk_pixbuf_unref(statusbox->connecting_pixbufs[i]);
+			g_object_unref(G_OBJECT(statusbox->connecting_pixbufs[i]));
 	}
 
 	for (i = 0; i < G_N_ELEMENTS(statusbox->typing_pixbufs); i++) {
 		if (statusbox->typing_pixbufs[i] != NULL)
-			gdk_pixbuf_unref(statusbox->typing_pixbufs[i]);
+			g_object_unref(G_OBJECT(statusbox->typing_pixbufs[i]));
 	}
 
 	g_object_unref(G_OBJECT(statusbox->store));
--- a/pidgin/gtkutils.c	Sat Apr 18 07:00:20 2009 +0000
+++ b/pidgin/gtkutils.c	Sat Apr 18 07:31:32 2009 +0000
@@ -1627,7 +1627,7 @@
 						    _("Set as buddy icon"), DND_BUDDY_ICON,
 						    (ft ? _("Send image file") : _("Insert in message")), (ft ? DND_FILE_TRANSFER : DND_IM_IMAGE),
 							NULL);
-			gdk_pixbuf_unref(pb);
+			g_object_unref(G_OBJECT(pb));
 			return;
 		}
 
--- a/pidgin/gtkwhiteboard.c	Sat Apr 18 07:00:20 2009 +0000
+++ b/pidgin/gtkwhiteboard.c	Sat Apr 18 07:31:32 2009 +0000
@@ -624,7 +624,7 @@
 							   update_rect.x, update_rect.y,
 							   update_rect.width, update_rect.height);
 
-	gdk_gc_unref(gfx_con);
+	g_object_unref(G_OBJECT(gfx_con));
 }
 
 /* Uses Bresenham's algorithm (as provided by Wikipedia) */
--- a/pidgin/plugins/markerline.c	Sat Apr 18 07:00:20 2009 +0000
+++ b/pidgin/plugins/markerline.c	Sat Apr 18 07:31:32 2009 +0000
@@ -84,7 +84,7 @@
 		gdk_gc_set_rgb_fg_color(gc, &red);
 		gdk_draw_line(event->window, gc,
 					0, y, visible_rect.width, y);
-		gdk_gc_unref(gc);
+		g_object_unref(G_OBJECT(gc));
 	}
 	return FALSE;
 }