Adapted Modest to latest Tinymail API
[modest] / src / modest-ui-actions.c
index 68ba9cd..2f0eb7e 100644 (file)
@@ -528,7 +528,9 @@ modest_ui_actions_on_delete_message (GtkAction *action, ModestWindow *win)
                modest_do_messages_delete (header_list, win);
                
                /* Enable window dimming management */
-               gtk_tree_selection_unselect_all (sel);
+               if (sel != NULL) {
+                       gtk_tree_selection_unselect_all (sel);
+               }
                modest_window_enable_dimming (MODEST_WINDOW(win));
                
                if (MODEST_IS_MSG_VIEW_WINDOW (win)) {
@@ -1530,6 +1532,11 @@ new_messages_arrived (ModestMailOperation *self,
        g_return_if_fail (MODEST_IS_MAIN_WINDOW (user_data));
        win = MODEST_MAIN_WINDOW (user_data);
 
+       /* Don't do anything if there are not new headers, this could
+          happen if there was any problem with the mail operation */
+       if (!new_headers)
+               return;
+
        /* Set contents style of headers view */
        if (modest_main_window_get_contents_style (win) == MODEST_MAIN_WINDOW_CONTENTS_STYLE_EMPTY) {
                folder_view = modest_main_window_get_child_widget (MODEST_MAIN_WINDOW (win), 
@@ -1545,7 +1552,7 @@ new_messages_arrived (ModestMailOperation *self,
        }       
 
        /* Notify new messages have been downloaded */
-       if (tny_list_get_length (new_headers) > 0) {
+       if ((new_headers != NULL) && (tny_list_get_length (new_headers) > 0)) {
                TnyIterator *iter = tny_list_create_iterator (new_headers);
                do {
                        TnyHeader *header =  NULL;
@@ -4707,7 +4714,7 @@ modest_ui_actions_on_send_queue_error_happened (TnySendQueue *self,
           should show the Accounts Settings dialog or the Connection
           specific SMTP server window */
 
-       modest_maemo_show_information_note_and_forget (NULL, message);
+       modest_platform_run_information_dialog (NULL, message);
        g_free (message);
 }