# HG changeset patch # User Rob Flynn # Date 1004040576 0 # Node ID 7938953630fa2467460090366bbc79df6d38b1fc # Parent d324478ee2035e1284579692ca5306c11a0b6bd9 [gaim-migrate @ 2625] I forgot about this. Don't show empty conversations. committer: Tailor Script diff -r d324478ee203 -r 7938953630fa src/dialogs.c --- a/src/dialogs.c Thu Oct 25 18:30:22 2001 +0000 +++ b/src/dialogs.c Thu Oct 25 20:09:36 2001 +0000 @@ -3478,13 +3478,16 @@ GtkWidget *clear_button; GtkWidget *save_button; GtkWidget *list = NULL; - GtkWidget *item; + GList *item_list = NULL; + GtkWidget *item = NULL; + GtkWidget *last = NULL; GtkWidget *frame; int options; guint block; char convo_start[32]; long offset = 0; + unsigned int i = 0; options = GTK_IMHTML_NO_COMMENTS | GTK_IMHTML_NO_TITLE | GTK_IMHTML_NO_SCROLL; @@ -3547,8 +3550,20 @@ if (strstr(buf, "---- New C")) { int length; char *temp = strchr(buf, '@'); + if (temp == NULL || strlen(temp) < 2) continue; + + if (i == 1) { + if (item_list) { + item_list = g_list_remove(item_list, last); + last = NULL; + } + } + + + i = 0; + temp++; length = strcspn(temp, "-"); if (length > 31) length = 31; @@ -3562,13 +3577,23 @@ gtk_object_set_data(GTK_OBJECT(item), "box", (gpointer)bbox); gtk_object_set_data(GTK_OBJECT(item), "window", (gpointer)window); gtk_signal_connect(GTK_OBJECT(item), "select", GTK_SIGNAL_FUNC(log_show_convo), layout); - gtk_container_add(GTK_CONTAINER(list), item); + last = item; + item_list = g_list_append(item_list, item); + gtk_widget_show(item); } + i++; } fclose(fp); } + if (i == 1) { + if (item_list) + item_list = g_list_remove(item_list, item); + } + + gtk_list_insert_items(GTK_LIST(list), item_list, 0 ); + gtk_signal_disconnect(GTK_OBJECT(window), block); gtk_signal_connect(GTK_OBJECT(window), "delete_event", GTK_SIGNAL_FUNC(destroy_dialog), window);