From b8fc17e8f9af33733e57aeeb5436bbd8c2c6076d Mon Sep 17 00:00:00 2001 From: Iain Holmes Date: Wed, 19 Sep 2001 00:11:58 +0000 Subject: Keep the mail folders in the correct order svn path=/trunk/; revision=12963 --- my-evolution/ChangeLog | 9 +++++++++ my-evolution/e-summary-mail.c | 22 ++++++++++++++++++++-- my-evolution/e-summary-preferences.c | 5 +++-- 3 files changed, 32 insertions(+), 4 deletions(-) diff --git a/my-evolution/ChangeLog b/my-evolution/ChangeLog index 5ce33ade93..e293f0d0a7 100644 --- a/my-evolution/ChangeLog +++ b/my-evolution/ChangeLog @@ -1,3 +1,12 @@ +2001-09-18 Iain Holmes + + * e-summary-preferences.c (mail_remove_clicked_cb): Select the next + folder for removal. + + * e-summary-mail.c (e_summary_mail_reconfigure): Don't do the hashtable + thing to get folders. Just iterate through the list lookuping the + folders instead. This keeps the required order. + 2001-09-18 Iain Holmes * e-summary-preferences.c (mail_add_clicked_cb): Don't add folders that diff --git a/my-evolution/e-summary-mail.c b/my-evolution/e-summary-mail.c index 2d3c2ef0e2..33945e3771 100644 --- a/my-evolution/e-summary-mail.c +++ b/my-evolution/e-summary-mail.c @@ -116,6 +116,8 @@ e_summary_mail_generate_html (ESummary *summary) g_string_append (string, "
"); for (p = mail->shown; p; p = p->next) { + ESummaryMailFolder *f = p->data; + folder_gen_html (summary, p->data, string); } @@ -183,7 +185,7 @@ new_folder_cb (EvolutionStorageListener *listener, uri = g_strconcat ("file://", p->data, NULL); if (strcmp (uri, mail_folder->path) == 0) { - mail->shown = g_list_prepend (mail->shown, mail_folder); + mail->shown = g_list_append (mail->shown, mail_folder); } g_free (uri); @@ -426,7 +428,7 @@ void e_summary_mail_reconfigure (ESummary *summary) { ESummaryMail *mail; - GList *old; + GList *old, *p; g_return_if_fail (summary != NULL); g_return_if_fail (IS_E_SUMMARY (summary)); @@ -434,12 +436,28 @@ e_summary_mail_reconfigure (ESummary *summary) mail = summary->mail; old = mail->shown; mail->shown = NULL; +#if 0 g_hash_table_foreach (mail->folders, maybe_add_to_shown, summary); e_summary_mail_generate_html (summary); +#endif + + for (p = summary->preferences->display_folders; p; p = p->next) { + ESummaryMailFolder *folder; + char *uri; + + uri = g_strconcat ("file://", p->data, NULL); + folder = g_hash_table_lookup (mail->folders, uri); + if (folder != NULL) { + mail->shown = g_list_append (mail->shown, folder); + } + + g_free (uri); + } /* Free the old list */ g_list_free (old); + e_summary_mail_generate_html (summary); e_summary_draw (summary); } diff --git a/my-evolution/e-summary-preferences.c b/my-evolution/e-summary-preferences.c index 43484c26be..3bdb6a6911 100644 --- a/my-evolution/e-summary-preferences.c +++ b/my-evolution/e-summary-preferences.c @@ -704,8 +704,8 @@ mail_add_clicked_cb (GtkButton *button, text[0] = rd->name + 1; row = gtk_clist_append (GTK_CLIST (pd->mail->shown), text); - pd->summary->preferences->display_folders = g_list_prepend (pd->summary->preferences->display_folders, - g_strdup (rd->uri + 7)); + pd->summary->preferences->display_folders = g_list_append (pd->summary->preferences->display_folders, + g_strdup (rd->uri + 7)); gtk_clist_set_row_data (GTK_CLIST (pd->mail->shown), row, pd->summary->preferences->display_folders); gnome_property_box_changed (pd->box); @@ -726,6 +726,7 @@ mail_remove_clicked_cb (GtkButton *button, g_free (p->data); g_list_free (p); + gtk_clist_select_row (GTK_CLIST (pd->mail->shown), row, 0); gnome_property_box_changed (pd->box); } -- cgit v1.2.3