Mercurial > pidgin.yaz
diff src/gtknotify.c @ 12257:ca27de274225
[gaim-migrate @ 14559]
Patches from Bartosz Oler with some changes by me.
The summary of changes is:
1. Fix a silly bug I introduced when editing previous patches.
2. Add some error handling.
3. Unify some types.
committer: Tailor Script <tailor@pidgin.im>
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Tue, 29 Nov 2005 19:26:03 +0000 |
parents | 976677e67239 |
children | d90eae2387b5 |
line wrap: on
line diff
--- a/src/gtknotify.c Tue Nov 29 18:25:12 2005 +0000 +++ b/src/gtknotify.c Tue Nov 29 19:26:03 2005 +0000 @@ -437,8 +437,9 @@ GtkListStore *model = data->model; GtkTreeIter iter; GdkPixbuf *icon, *scaled; - int col_num; - int i, j; + guint col_num; + guint i; + guint j; gtk_list_store_clear(data->model); @@ -477,9 +478,8 @@ GType *col_types; GtkListStore *model; GtkCellRenderer *renderer; - int col_num; - int i; - guint j; + guint col_num; + guint i; GList *buttons = NULL; GtkWidget *vbox; @@ -490,6 +490,9 @@ char *label_text; char *primary_esc, *secondary_esc; + g_return_val_if_fail(gc != NULL, NULL); + g_return_val_if_fail(results != NULL, NULL); + data = g_malloc(sizeof(GaimNotifySearchResultsData)); /* Create the window */ @@ -575,8 +578,8 @@ gtk_box_set_spacing(GTK_BOX(button_area), GAIM_HIG_BORDER); gtk_widget_show(button_area); - for (j = 0; j < g_list_length(results->buttons); j++) { - GaimNotifySearchButton *b = g_list_nth_data(results->buttons, j); + for (i = 0; i < g_list_length(results->buttons); i++) { + GaimNotifySearchButton *b = g_list_nth_data(results->buttons, i); button = NULL; switch (b->type) { case GAIM_NOTIFY_BUTTON_CONTINUE: @@ -609,7 +612,7 @@ gaim_gtk_notify_searchresults_new_rows(gc, results, data, NULL); /* Connect Signals */ - for (j = 0; j < g_list_length(results->buttons); j++) { + for (i = 0; i < g_list_length(results->buttons); i++) { GaimNotifySearchResultsButtonData *bd = g_new0(GaimNotifySearchResultsButtonData, 1); bd->button = g_list_nth_data(results->buttons, i); bd->data = data;