Mercurial > pidgin
changeset 29420:2d04fb25c6db
Revert the unnecessary addition of the pixbuf boolean to PurpleRequestField.list
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Sun, 16 Nov 2008 08:16:17 +0000 |
parents | 297d83036107 |
children | 7f4f416e3c0b |
files | libpurple/protocols/oscar/oscar.c libpurple/request.c libpurple/request.h pidgin/gtkrequest.c |
diffstat | 4 files changed, 9 insertions(+), 53 deletions(-) [+] |
line wrap: on
line diff
--- a/libpurple/protocols/oscar/oscar.c Sun Nov 16 08:11:33 2008 +0000 +++ b/libpurple/protocols/oscar/oscar.c Sun Nov 16 08:16:17 2008 +0000 @@ -6784,8 +6784,6 @@ f = purple_request_field_list_new("customicon", _("XStatus")); - purple_request_field_list_set_pixbuf(f, TRUE); - na_fn = g_build_filename("pixmaps", "pidgin", "emblems", "16", "not-authorized.png", NULL); purple_request_field_list_add_icon(f, _("None"), na_fn, GINT_TO_POINTER(-1));
--- a/libpurple/request.c Sun Nov 16 08:11:33 2008 +0000 +++ b/libpurple/request.c Sun Nov 16 08:16:17 2008 +0000 @@ -790,25 +790,6 @@ } void -purple_request_field_list_set_pixbuf(PurpleRequestField *field, - gboolean pixbuf) -{ - g_return_if_fail(field != NULL); - g_return_if_fail(field->type == PURPLE_REQUEST_FIELD_LIST); - - field->u.list.pixbuf = pixbuf; -} - -gboolean -purple_request_field_list_get_pixbuf(const PurpleRequestField *field) -{ - g_return_val_if_fail(field != NULL, FALSE); - g_return_val_if_fail(field->type == PURPLE_REQUEST_FIELD_LIST, FALSE); - - return field->u.list.pixbuf; -} - -void purple_request_field_list_set_multi_select(PurpleRequestField *field, gboolean multi_select) { @@ -975,7 +956,6 @@ { g_return_val_if_fail(field != NULL, NULL); g_return_val_if_fail(field->type == PURPLE_REQUEST_FIELD_LIST, NULL); - g_return_val_if_fail(field->u.list.pixbuf == TRUE, NULL); return field->u.list.icons; }
--- a/libpurple/request.h Sun Nov 16 08:11:33 2008 +0000 +++ b/libpurple/request.h Sun Nov 16 08:16:17 2008 +0000 @@ -152,7 +152,6 @@ GHashTable *selected_table; gboolean multiple_selection; - gboolean pixbuf; } list; @@ -879,26 +878,6 @@ PurpleRequestField *purple_request_field_list_new(const char *id, const char *text); /** - * Sets whether or not a list field allows icons. - * - * @param field The list field. - * @param multi_select TRUE if icons are enabled, - * or FALSE otherwise. - */ -void purple_request_field_list_set_pixbuf(PurpleRequestField *field, - gboolean pixbuf); - -/** - * Returns whether or not a list field allows icons. - * - * @param field The list field. - * - * @return TRUE if icons are enabled, or FALSE otherwise. - */ -gboolean purple_request_field_list_get_pixbuf( - const PurpleRequestField *field); - -/** * Sets whether or not a list field allows multiple selection. * * @param field The list field.
--- a/pidgin/gtkrequest.c Sun Nov 16 08:11:33 2008 +0000 +++ b/pidgin/gtkrequest.c Sun Nov 16 08:16:17 2008 +0000 @@ -995,9 +995,11 @@ GtkTreeSelection *sel; GtkTreeViewColumn *column; GtkTreeIter iter; - GList *l, *ic = NULL; + GList *l; + GList *icons = NULL; GdkPixbuf* pixbuf; - gboolean icon = purple_request_field_list_get_pixbuf(field); + + icons = purple_request_field_list_get_icons(field); /* Create the scrolled window */ sw = gtk_scrolled_window_new(NULL, NULL); @@ -1009,7 +1011,7 @@ gtk_widget_show(sw); /* Create the list store */ - if (icon) + if (icons) store = gtk_list_store_new(3, G_TYPE_POINTER, G_TYPE_STRING, GDK_TYPE_PIXBUF); else store = gtk_list_store_new(2, G_TYPE_POINTER, G_TYPE_STRING); @@ -1031,7 +1033,7 @@ gtk_tree_view_column_pack_start(column, renderer, TRUE); gtk_tree_view_column_add_attribute(column, renderer, "text", 1); - if(icon == TRUE) + if (icons) { renderer = gtk_cell_renderer_pixbuf_new(); gtk_tree_view_column_pack_start(column, renderer, TRUE); @@ -1040,18 +1042,15 @@ gtk_widget_set_size_request(treeview, 200, 400); } - if(icon == TRUE) - ic = purple_request_field_list_get_icons(field); - for (l = purple_request_field_list_get_items(field); l != NULL; l = l->next) { const char *text = (const char *)l->data; gtk_list_store_append(store, &iter); - if(icon == TRUE) + if (icons) { - const char *icon_path = (const char *)ic->data; + const char *icon_path = (const char *)icons->data; char* filename = g_build_filename(DATADIR, icon_path, NULL); pixbuf = gdk_pixbuf_new_from_file(filename, NULL); @@ -1063,7 +1062,7 @@ 1, text, 2, pixbuf, -1); - ic = ic->next; + icons = icons->next; } else gtk_list_store_set(store, &iter,