* Fixed a bug related with filter_row function and
authorJavier Fernandez Garcia-Boente <jfernandez@igalia.com>
Tue, 14 Aug 2007 10:22:33 +0000 (10:22 +0000)
committerJavier Fernandez Garcia-Boente <jfernandez@igalia.com>
Tue, 14 Aug 2007 10:22:33 +0000 (10:22 +0000)
recent new boolean field 'empty' added to header-view
priv structure.

pmo-trunk-r2981

src/modest-mail-operation.c
src/modest-ui-actions.c

index 02835cc..cb84f12 100644 (file)
@@ -1400,6 +1400,7 @@ update_account_thread (gpointer thr_user_data)
                idle_info->mail_op = g_object_ref (info->mail_op);
                idle_info->new_headers = num_new_headers;
                idle_info->callback = info->callback;
+               idle_info->user_data = info->user_data;
                g_idle_add (idle_update_account_cb, idle_info);
        }
 
index 41b70d1..e11fb9b 100644 (file)
@@ -1768,6 +1768,8 @@ folder_refreshed_cb (ModestMailOperation *mail_op,
        ModestMainWindow *win = NULL;
        GtkWidget *header_view;
        TnyFolder *current_folder;
+       gboolean folder_empty = TRUE;
+       gboolean all_marked_as_deleted = TRUE;
 
        g_return_if_fail (TNY_IS_FOLDER (folder));
 
@@ -1783,7 +1785,11 @@ folder_refreshed_cb (ModestMailOperation *mail_op,
        }
 
        /* Check if folder is empty and set headers view contents style */
-       if (tny_folder_get_all_count (folder) == 0) {
+       folder_empty = (tny_folder_get_all_count (folder) == 0);
+       all_marked_as_deleted = modest_header_view_is_empty (MODEST_HEADER_VIEW(header_view));
+       folder_empty = folder_empty || all_marked_as_deleted ;
+       if (folder_empty) {
+
        printf ("DEBUG: %s: tny_folder_get_all_count() returned 0.\n", __FUNCTION__);
                modest_main_window_set_contents_style (win,
                                                       MODEST_MAIN_WINDOW_CONTENTS_STYLE_EMPTY);