From 4ac55901e91565aa5a7e43b2eb57b672a9d3a799 Mon Sep 17 00:00:00 2001 From: Jose Dapena Paz Date: Thu, 14 May 2009 13:13:11 +0200 Subject: [PATCH] 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). --- src/modest-ui-actions.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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); } -- 1.7.9.5