X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=src%2Fmodest-ui-actions.c;h=64e61373d52d9b87f0723351924c2fa9ec76db85;hb=fd8081e39e94c248784cf66a3cc5de76f5261155;hp=27db767e60cecc3b6004a641410cb541208e8029;hpb=13a6f218747f48162aa1b4b15c281b6edd1992c4;p=modest diff --git a/src/modest-ui-actions.c b/src/modest-ui-actions.c index 27db767..64e6137 100644 --- a/src/modest-ui-actions.c +++ b/src/modest-ui-actions.c @@ -863,7 +863,7 @@ modest_ui_actions_compose_msg(ModestWindow *win, if (expected_size > MODEST_MAX_ATTACHMENT_SIZE) { modest_platform_run_information_dialog ( GTK_WINDOW(win), - _FM("sfil_ib_opening_not_allowed"), + _("mail_ib_error_attachment_size"), TRUE); return; } @@ -1001,7 +1001,8 @@ modest_ui_actions_msg_retrieval_check (ModestMailOperation *mail_op, error->code == TNY_SERVICE_ERROR_MESSAGE_NOT_AVAILABLE)) { gchar *subject, *msg, *format = NULL; TnyAccount *account; - subject = tny_header_dup_subject (header); + + subject = header?tny_header_dup_subject (header):NULL; if (!subject) subject = g_strdup (_("mail_va_no_subject")); @@ -1744,20 +1745,27 @@ reply_forward_cb (ModestMailOperation *mail_op, /* Create reply mail */ switch (rf_helper->action) { + /* Use the msg_header to ensure that we have all the + information. The summary can lack some data */ + TnyHeader *msg_header; case ACTION_REPLY: + msg_header = tny_msg_get_header (msg); new_msg = - modest_tny_msg_create_reply_msg (msg, header, from, + modest_tny_msg_create_reply_msg (msg, msg_header, from, (use_signature) ? signature : NULL, rf_helper->reply_forward_type, MODEST_TNY_MSG_REPLY_MODE_SENDER); + g_object_unref (msg_header); break; case ACTION_REPLY_TO_ALL: + msg_header = tny_msg_get_header (msg); new_msg = - modest_tny_msg_create_reply_msg (msg, header, from, + modest_tny_msg_create_reply_msg (msg, msg_header, from, (use_signature) ? signature : NULL, rf_helper->reply_forward_type, MODEST_TNY_MSG_REPLY_MODE_ALL); edit_type = MODEST_EDIT_TYPE_REPLY; + g_object_unref (msg_header); break; case ACTION_FORWARD: new_msg = @@ -2297,7 +2305,7 @@ modest_ui_actions_do_send_receive (const gchar *account_name, if (!acc_name) acc_name = modest_account_mgr_get_default_account (modest_runtime_get_account_mgr()); if (!acc_name) { - g_printerr ("modest: cannot get default account\n"); + modest_platform_information_banner (NULL, NULL, _("emev_ni_internal_error")); return; } } else { @@ -2307,6 +2315,12 @@ modest_ui_actions_do_send_receive (const gchar *account_name, acc_store = modest_runtime_get_account_store (); account = modest_tny_account_store_get_server_account (acc_store, acc_name, TNY_ACCOUNT_TYPE_STORE); + if (!account) { + g_free (acc_name); + modest_platform_information_banner (NULL, NULL, _("emev_ni_internal_error")); + return; + } + /* Do not automatically refresh accounts that are flagged as NO_AUTO_UPDATE. This could be useful for accounts that handle their own update times */ @@ -2929,7 +2943,7 @@ enough_space_for_message (ModestMsgEditWindow *edit_window, if (expected_size > MODEST_MAX_ATTACHMENT_SIZE) { modest_platform_run_information_dialog ( GTK_WINDOW(edit_window), - _FM("sfil_ib_opening_not_allowed"), + _("mail_ib_error_attachment_size"), TRUE); return FALSE; } @@ -3364,7 +3378,7 @@ do_create_folder_cb (ModestMailOperation *mail_op, error = modest_mail_operation_get_error (mail_op); if (error) { - gboolean disk_full; + gboolean disk_full = FALSE; TnyAccount *account; /* Show an error. If there was some problem writing to disk, show it, otherwise show the generic folder @@ -5366,7 +5380,7 @@ modest_ui_actions_move_folder_error_handler (ModestMailOperation *mail_op, { GObject *win = NULL; const GError *error; - TnyAccount *account; + TnyAccount *account = NULL; #ifndef MODEST_TOOLKIT_HILDON2 ModestWindow *main_window = NULL; @@ -5391,7 +5405,11 @@ modest_ui_actions_move_folder_error_handler (ModestMailOperation *mail_op, #endif win = modest_mail_operation_get_source (mail_op); error = modest_mail_operation_get_error (mail_op); - account = modest_mail_operation_get_account (mail_op); + + if (TNY_IS_FOLDER (user_data)) + account = modest_tny_folder_get_account (TNY_FOLDER (user_data)); + else if (TNY_IS_ACCOUNT (user_data)) + account = g_object_ref (user_data); /* If it's not a disk full error then show a generic error */ if (!modest_tny_account_store_check_disk_full_error (modest_runtime_get_account_store(), @@ -5804,15 +5822,10 @@ on_move_folder_cb (gboolean canceled, mail_op = modest_mail_operation_new_with_error_handling (G_OBJECT(parent_window), - modest_ui_actions_move_folder_error_handler, - info->src_folder, NULL); + modest_ui_actions_move_folder_error_handler, + g_object_ref (info->dst_folder), g_object_unref); modest_mail_operation_queue_add (modest_runtime_get_mail_operation_queue (), - mail_op); - - /* Select *after* the changes */ - /* TODO: this function hangs UI after transfer */ - /* modest_folder_view_select_folder (MODEST_FOLDER_VIEW(folder_view), */ - /* TNY_FOLDER (src_folder), TRUE); */ + mail_op); if (MODEST_IS_MAIN_WINDOW (parent_window)) { modest_folder_view_select_folder (MODEST_FOLDER_VIEW(info->folder_view),