diff options
author | Elliott Sales de Andrade <qulogic@pidgin.im> | 2009-04-18 07:31:32 +0000 |
---|---|---|
committer | Elliott Sales de Andrade <qulogic@pidgin.im> | 2009-04-18 07:31:32 +0000 |
commit | b6caf799f71931f992c4cc73bd24a58599fa1eea (patch) | |
tree | 3740ce84d8e924d8da1c13827cf1d1bfe09414ec | |
parent | a48ea494497f526971b7cc22a5db3c05260dc9db (diff) | |
download | pidgin-b6caf799f71931f992c4cc73bd24a58599fa1eea.tar.gz |
Use g_object_ref/unref instead of the deprecated versions.
-rw-r--r-- | pidgin/gtkaccount.c | 12 | ||||
-rw-r--r-- | pidgin/gtkdialogs.c | 2 | ||||
-rw-r--r-- | pidgin/gtkprefs.c | 4 | ||||
-rw-r--r-- | pidgin/gtksmiley.c | 4 | ||||
-rw-r--r-- | pidgin/gtkstatusbox.c | 4 | ||||
-rw-r--r-- | pidgin/gtkutils.c | 2 | ||||
-rw-r--r-- | pidgin/gtkwhiteboard.c | 2 | ||||
-rw-r--r-- | pidgin/plugins/markerline.c | 2 |
8 files changed, 22 insertions, 10 deletions
diff --git a/pidgin/gtkaccount.c b/pidgin/gtkaccount.c index b303b2d0b7..98abdafb3d 100644 --- a/pidgin/gtkaccount.c +++ b/pidgin/gtkaccount.c @@ -413,7 +413,11 @@ add_login_options(AccountPrefsDialog *dialog, GtkWidget *parent) 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 @@ add_login_options(AccountPrefsDialog *dialog, GtkWidget *parent) { 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(); diff --git a/pidgin/gtkdialogs.c b/pidgin/gtkdialogs.c index e63d6b78e2..91b9f6daee 100644 --- a/pidgin/gtkdialogs.c +++ b/pidgin/gtkdialogs.c @@ -427,7 +427,7 @@ void pidgin_dialogs_about() #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); diff --git a/pidgin/gtkprefs.c b/pidgin/gtkprefs.c index d07bd7f374..d024946aec 100644 --- a/pidgin/gtkprefs.c +++ b/pidgin/gtkprefs.c @@ -638,7 +638,7 @@ prefs_themes_sort(PurpleTheme *theme) 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 @@ prefs_themes_sort(PurpleTheme *theme) g_free(markup); if (pixbuf != NULL) - gdk_pixbuf_unref(pixbuf); + g_object_unref(G_OBJECT(pixbuf)); } } diff --git a/pidgin/gtksmiley.c b/pidgin/gtksmiley.c index d8f0b3e422..38289f6d30 100644 --- a/pidgin/gtksmiley.c +++ b/pidgin/gtksmiley.c @@ -74,7 +74,7 @@ pidgin_smiley_destroy(PidginSmiley *smiley) 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 @@ pidgin_smiley_editor_set_image(PidginSmiley *editor, GdkPixbuf *image) { 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); } diff --git a/pidgin/gtkstatusbox.c b/pidgin/gtkstatusbox.c index 8f52ea4af6..d59189f607 100644 --- a/pidgin/gtkstatusbox.c +++ b/pidgin/gtkstatusbox.c @@ -536,12 +536,12 @@ pidgin_status_box_finalize(GObject *obj) 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)); diff --git a/pidgin/gtkutils.c b/pidgin/gtkutils.c index 4e9d946c0e..3d780bc4a2 100644 --- a/pidgin/gtkutils.c +++ b/pidgin/gtkutils.c @@ -1627,7 +1627,7 @@ pidgin_dnd_file_manage(GtkSelectionData *sd, PurpleAccount *account, const char _("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; } diff --git a/pidgin/gtkwhiteboard.c b/pidgin/gtkwhiteboard.c index 38c045f5de..dbc528ebcc 100644 --- a/pidgin/gtkwhiteboard.c +++ b/pidgin/gtkwhiteboard.c @@ -624,7 +624,7 @@ static void pidgin_whiteboard_draw_brush_point(PurpleWhiteboard *wb, int x, int 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) */ diff --git a/pidgin/plugins/markerline.c b/pidgin/plugins/markerline.c index 9d0d11a2e1..214994a906 100644 --- a/pidgin/plugins/markerline.c +++ b/pidgin/plugins/markerline.c @@ -84,7 +84,7 @@ imhtml_expose_cb(GtkWidget *widget, GdkEventExpose *event, PidginConversation *g 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; } |