From: Jose Dapena Paz Date: Thu, 14 May 2009 11:13:11 +0000 (+0200) Subject: Fix cummulative checking of attachments size on modest_ui_actions_compose_msg X-Git-Tag: 3.0.17-rc5~4 X-Git-Url: http://git.maemo.org/git/?p=modest;a=commitdiff_plain;h=4ac55901e91565aa5a7e43b2eb57b672a9d3a799 Fix cummulative checking of attachments size on modest_ui_actions_compose_msg * src/modest-ui-actions.c (modest_ui_actions_on_compose_msg): fix the second calculation of the space allocated by attachments, as it was wrong (fixes NB#111542). --- diff --git a/src/modest-ui-actions.c b/src/modest-ui-actions.c index f94973a..e6fc380 100644 --- a/src/modest-ui-actions.c +++ b/src/modest-ui-actions.c @@ -931,16 +931,18 @@ modest_ui_actions_compose_msg(ModestWindow *win, gtk_widget_show_all (GTK_WIDGET (msg_win)); while (attachments) { - total_size += + GnomeVFSFileSize att_size; + att_size = modest_msg_edit_window_attach_file_one((ModestMsgEditWindow *)msg_win, attachments->data, allowed_size); + total_size += att_size; - if (total_size > allowed_size) { + if (att_size > allowed_size) { g_warning ("%s: total size: %u", __FUNCTION__, (unsigned int)total_size); break; } - allowed_size -= total_size; + allowed_size -= att_size; attachments = g_slist_next(attachments); }