From: Richard L. <rl...@us...> - 2005-11-29 19:26:12
|
Update of /cvsroot/gaim/gaim/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2007/src Modified Files: gtknotify.c notify.c notify.h Log Message: 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. Index: gtknotify.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/gtknotify.c,v retrieving revision 1.90 retrieving revision 1.91 diff -u -d -p -r1.90 -r1.91 --- gtknotify.c 28 Nov 2005 01:50:55 -0000 1.90 +++ gtknotify.c 29 Nov 2005 19:26:03 -0000 1.91 @@ -437,8 +437,9 @@ gaim_gtk_notify_searchresults_new_rows(G 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 @@ gaim_gtk_notify_searchresults(GaimConnec 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 @@ gaim_gtk_notify_searchresults(GaimConnec 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 @@ gaim_gtk_notify_searchresults(GaimConnec 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(GaimConnec 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; Index: notify.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/notify.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -p -r1.19 -r1.20 --- notify.c 28 Nov 2005 01:50:56 -0000 1.19 +++ notify.c 29 Nov 2005 19:26:03 -0000 1.20 @@ -301,18 +301,18 @@ gaim_notify_searchresults_column_new(con return sc; } -int +guint gaim_notify_searchresults_get_columns_count(GaimNotifySearchResults *results) { - g_return_val_if_fail(results != NULL, -1); + g_return_val_if_fail(results != NULL, 0); return g_list_length(results->columns); } -int +guint gaim_notify_searchresults_get_rows_count(GaimNotifySearchResults *results) { - g_return_val_if_fail(results != NULL, -1); + g_return_val_if_fail(results != NULL, 0); return g_list_length(results->rows); } Index: notify.h =================================================================== RCS file: /cvsroot/gaim/gaim/src/notify.h,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -p -r1.26 -r1.27 --- notify.h 28 Nov 2005 01:50:56 -0000 1.26 +++ notify.h 29 Nov 2005 19:26:03 -0000 1.27 @@ -228,18 +228,18 @@ void gaim_notify_searchresults_row_add(G * * @param results The search results object. * - * @return Number of the result rows. Or -1 if an error occurrs. + * @return Number of the result rows. */ -int gaim_notify_searchresults_get_rows_count(GaimNotifySearchResults *results); +guint gaim_notify_searchresults_get_rows_count(GaimNotifySearchResults *results); /** * Returns a number of the columns in the search results object. * * @param results The search results object. * - * @return Number of the columns. Or -1 if an error occurrs. + * @return Number of the columns. */ -int gaim_notify_searchresults_get_columns_count(GaimNotifySearchResults *results); +guint gaim_notify_searchresults_get_columns_count(GaimNotifySearchResults *results); /** * Returns a row of the results from the search results object. |