* Fixed NB#97137, set the progress hint to false when the mail operation finishes
authorSergio Villar Senin <svillar@igalia.com>
Fri, 9 Jan 2009 12:00:50 +0000 (12:00 +0000)
committerSergio Villar Senin <svillar@igalia.com>
Fri, 9 Jan 2009 12:00:50 +0000 (12:00 +0000)
pmo-trunk-r7088

src/hildon2/modest-header-window.c

index 65e2973..d523dfb 100644 (file)
@@ -803,15 +803,25 @@ on_mail_operation_finished (ModestMailOperation *mail_op,
 {
        ModestHeaderWindow *self;
        ModestMailOperationTypeOperation op_type;
 {
        ModestHeaderWindow *self;
        ModestMailOperationTypeOperation op_type;
-       
+       GSList *operations = NULL;
+       ModestMailOperationQueue *queue;
+
        self = MODEST_HEADER_WINDOW (user_data);
        op_type = modest_mail_operation_get_type_operation (mail_op);
        self = MODEST_HEADER_WINDOW (user_data);
        op_type = modest_mail_operation_get_type_operation (mail_op);
-       
-       /* If no more operations are being observed, NORMAL mode is enabled again */
-       if (modest_mail_operation_queue_num_elements (modest_runtime_get_mail_operation_queue ()) == 0) {
+
+       queue = modest_runtime_get_mail_operation_queue ();
+       operations = modest_mail_operation_queue_get_by_source (queue, user_data);
+
+       /* There should be at least the current one */
+       if (!operations)
+               g_return_if_reached ();
+
+       /* Don't disable the progress hint if there are more pending
+          operations from this window */
+       if (g_slist_length (operations) == 1)
                set_progress_hint (self, FALSE);
                set_progress_hint (self, FALSE);
-       }
-       
+
+       g_slist_free (operations);
        modest_ui_actions_check_menu_dimming_rules (MODEST_WINDOW (self));
 }
 
        modest_ui_actions_check_menu_dimming_rules (MODEST_WINDOW (self));
 }