Mercurial > pidgin
diff plugins/gevolution/add_buddy_dialog.c @ 13090:0aa231ebbfd5
[gaim-migrate @ 15452]
Changes to some pixbuf stuff.
I added a 'gaim_gtk_create_gaim_icon_with_status()' function to util.c,
and changed 'gaim_gtk_create_prpl_icon_with_status()' to accept a scale
factor because almost everywhere this function was used we would scale
the pixbuf to a smaller size as soon as we got it. So there's a bit less
code duplication.
Also, I think I added some g_object_unref()'s in one or two places where
it was missing.
committer: Tailor Script <tailor@pidgin.im>
| author | Mark Doliner <mark@kingant.net> |
|---|---|
| date | Wed, 01 Feb 2006 22:38:34 +0000 |
| parents | 1f70f265cf27 |
| children | d2e5a9f2c174 |
line wrap: on
line diff
--- a/plugins/gevolution/add_buddy_dialog.c Wed Feb 01 06:07:53 2006 +0000 +++ b/plugins/gevolution/add_buddy_dialog.c Wed Feb 01 22:38:34 2006 +0000 @@ -163,7 +163,7 @@ GaimAccount *account = NULL; GList *l; GtkTreeIter iter; - GdkPixbuf *pixbuf, *icon = NULL; + GdkPixbuf *pixbuf; if (list == NULL) return; @@ -183,11 +183,7 @@ if (account == NULL) return; - pixbuf = gaim_gtk_create_prpl_icon(account); - - if (pixbuf != NULL) - icon = gdk_pixbuf_scale_simple(pixbuf, 16, 16, - GDK_INTERP_BILINEAR); + pixbuf = gaim_gtk_create_prpl_icon(account, 0.5); for (l = list; l != NULL; l = l->next) { @@ -203,7 +199,7 @@ gtk_list_store_set(dialog->model, &iter, COLUMN_NAME, name, - COLUMN_PRPL_ICON, icon, + COLUMN_PRPL_ICON, pixbuf, COLUMN_USERNAME, account_name, COLUMN_DATA, contact, -1); @@ -223,8 +219,8 @@ } } - if (pixbuf != NULL) g_object_unref(G_OBJECT(pixbuf)); - if (icon != NULL) g_object_unref(G_OBJECT(icon)); + if (pixbuf != NULL) + g_object_unref(G_OBJECT(pixbuf)); g_list_foreach(list, (GFunc)g_free, NULL); g_list_free(list); @@ -611,19 +607,16 @@ EContact *contact, const char *name, GaimAccount *account, const char *screenname) { - GdkPixbuf *pixbuf, *icon = NULL; + GdkPixbuf *pixbuf; GtkTreeIter iter; - pixbuf = gaim_gtk_create_prpl_icon(account); - - if (pixbuf != NULL) - icon = gdk_pixbuf_scale_simple(pixbuf, 16, 16, GDK_INTERP_BILINEAR); + pixbuf = gaim_gtk_create_prpl_icon(account, 0.5); gtk_list_store_append(dialog->model, &iter); gtk_list_store_set(dialog->model, &iter, COLUMN_NAME, name, - COLUMN_PRPL_ICON, icon, + COLUMN_PRPL_ICON, pixbuf, COLUMN_DATA, contact, COLUMN_USERNAME, screenname, -1); @@ -631,6 +624,6 @@ if (contact != NULL) dialog->contacts = g_list_append(dialog->contacts, contact); - if (pixbuf != NULL) g_object_unref(G_OBJECT(pixbuf)); - if (icon != NULL) g_object_unref(G_OBJECT(icon)); + if (pixbuf != NULL) + g_object_unref(G_OBJECT(pixbuf)); }
