diff -r 3e480c5ee53b -r c7494ef1530d pidgin/gtknotify.c
--- a/pidgin/gtknotify.c Fri Sep 28 16:32:28 2007 +0000
+++ b/pidgin/gtknotify.c Fri Sep 28 16:34:43 2007 +0000
@@ -559,8 +559,8 @@
if (!GTK_WIDGET_VISIBLE(dialog)) {
GdkPixbuf *pixbuf = gtk_widget_render_icon(dialog, PIDGIN_STOCK_DIALOG_MAIL,
gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL), NULL);
- char *label_text = g_strdup_printf(ngettext("You have %d new e-mail.",
- "You have %d new e-mails.",
+ char *label_text = g_strdup_printf(ngettext("%d new e-mail.",
+ "%d new e-mails.",
mail_dialog->total_count), mail_dialog->total_count);
mail_dialog->in_use = TRUE; /* So that _set_headline doesn't accidentally
remove the notifications when replacing an
@@ -690,30 +690,30 @@
GtkTreeIter iter;
GdkPixbuf *pixbuf;
guint col_num;
- guint i;
- guint j;
+ GList *row, *column;
+ guint n;
gtk_list_store_clear(data->model);
pixbuf = pidgin_create_prpl_icon(purple_connection_get_account(gc), 0.5);
/* +1 is for the automagically created Status column. */
- col_num = purple_notify_searchresults_get_columns_count(results) + 1;
+ col_num = g_list_length(results->columns) + 1;
- for (i = 0; i < purple_notify_searchresults_get_rows_count(results); i++) {
- GList *row = purple_notify_searchresults_row_get(results, i);
+ for (row = results->rows; row != NULL; row = row->next) {
gtk_list_store_append(model, &iter);
gtk_list_store_set(model, &iter, 0, pixbuf, -1);
- for (j = 1; j < col_num; j++) {
+ n = 1;
+ for (column = row->data; column != NULL; column = column->next) {
GValue v;
- char *data = g_list_nth_data(row, j - 1);
v.g_type = 0;
g_value_init(&v, G_TYPE_STRING);
- g_value_set_string(&v, data);
- gtk_list_store_set_value(model, &iter, j, &v);
+ g_value_set_string(&v, column->data);
+ gtk_list_store_set_value(model, &iter, n, &v);
+ n++;
}
}
@@ -733,6 +733,7 @@
GtkListStore *model;
GtkCellRenderer *renderer;
guint col_num;
+ GList *column;
guint i;
GtkWidget *vbox;
@@ -780,7 +781,7 @@
g_free(label_text);
/* +1 is for the automagically created Status column. */
- col_num = purple_notify_searchresults_get_columns_count(results) + 1;
+ col_num = g_list_length(results->columns) + 1;
/* Setup the list model */
col_types = g_new0(GType, col_num);
@@ -815,12 +816,13 @@
gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(treeview),
-1, "", renderer, "pixbuf", 0, NULL);
- for (i = 1; i < col_num; i++) {
+ i = 1;
+ for (column = results->columns; column != NULL; column = column->next) {
renderer = gtk_cell_renderer_text_new();
gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(treeview), -1,
- purple_notify_searchresults_column_get_title(results, i-1),
- renderer, "text", i, NULL);
+ column->data, renderer, "text", i, NULL);
+ i++;
}
for (i = 0; i < g_list_length(results->buttons); i++) {