From: Jose Dapena Paz Date: Tue, 27 Jan 2009 20:10:46 +0000 (+0000) Subject: On saving attachments, detect no space condition (fixes NB#96905). X-Git-Tag: git_migration_finished~703 X-Git-Url: http://git.maemo.org/git/?p=modest;a=commitdiff_plain;h=8f86af51f9f66941446129ce2916bb3c819df5e7;ds=sidebyside On saving attachments, detect no space condition (fixes NB#96905). pmo-trunk-r7325 --- diff --git a/src/hildon2/modest-msg-view-window.c b/src/hildon2/modest-msg-view-window.c index ea5ba0d..66df0c9 100644 --- a/src/hildon2/modest-msg-view-window.c +++ b/src/hildon2/modest-msg-view-window.c @@ -33,6 +33,7 @@ #include #include #include +#include #include "modest-marshal.h" #include "modest-platform.h" #include @@ -2644,8 +2645,14 @@ save_mime_part_to_file (SaveMimePartInfo *info) stream = tny_vfs_stream_new (handle); if (tny_mime_part_decode_to_stream (pair->part, stream, &error) < 0) { g_warning ("modest: could not save attachment %s: %d (%s)\n", pair->filename, error?error->code:-1, error?error->message:"Unknown error"); - - info->result = GNOME_VFS_ERROR_IO; + + if ((error->domain == TNY_ERROR_DOMAIN) && + (error->code = TNY_IO_ERROR_WRITE) && + (errno == ENOSPC)) { + info->result = GNOME_VFS_ERROR_NO_SPACE; + } else { + info->result = GNOME_VFS_ERROR_IO; + } } g_object_unref (G_OBJECT (stream)); g_object_unref (pair->part);