From: Sergio Villar Senin Date: Tue, 16 Jun 2009 12:28:43 +0000 (+0200) Subject: Fixes NB#119629, wrong notification shown when moving a folder to a disk full externa... X-Git-Tag: 3.0.17-rc16~11 X-Git-Url: http://git.maemo.org/git/?p=modest;a=commitdiff_plain;h=aecce08bd5d63d0676b08df14aa8387a6c9dfa3e Fixes NB#119629, wrong notification shown when moving a folder to a disk full external storage The old code was checking the disk full condition of the source folder instead of the destination device --- diff --git a/src/modest-ui-actions.c b/src/modest-ui-actions.c index 13df186..6f6722d 100644 --- a/src/modest-ui-actions.c +++ b/src/modest-ui-actions.c @@ -5379,7 +5379,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; @@ -5404,7 +5404,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(), @@ -5817,15 +5821,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),