From: Jose Dapena Paz Date: Tue, 17 Mar 2009 20:45:57 +0000 (+0000) Subject: Temp streams are removed always when same file is requested to be saved X-Git-Tag: git_migration_finished~275 X-Git-Url: http://git.maemo.org/git/?p=modest;a=commitdiff_plain;h=315d8bfd8df561b5e07646caf186ff65335ba5ef;ds=sidebyside Temp streams are removed always when same file is requested to be saved pmo-trunk-r8129 --- diff --git a/src/modest-utils.c b/src/modest-utils.c index eb21481..33b5a04 100644 --- a/src/modest-utils.c +++ b/src/modest-utils.c @@ -155,6 +155,12 @@ modest_utils_create_temp_stream (const gchar *orig_name, const gchar *hash_base, } filepath = g_strconcat (tmpdir, "/", orig_name, NULL); + + /* if file exists, first we try to remove it */ + if (modest_utils_file_exists (filepath)) { + g_unlink (filepath); + } + /* don't overwrite if it already exists, even if it is writable */ if (modest_utils_file_exists (filepath)) { if (path!=NULL) {