aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/misc/e-attachment.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2009-05-13 23:39:18 +0800
committerMatthew Barnes <mbarnes@redhat.com>2009-05-13 23:39:18 +0800
commit00cf33a815541bc2e4a2d96e29900241bf58c379 (patch)
tree770cefddfb7359259cafc6dadffb9c8f7374a1e5 /widgets/misc/e-attachment.c
parentfee1642fc78d80a382c5c96cb294f4bd3d00be77 (diff)
downloadgsoc2013-evolution-00cf33a815541bc2e4a2d96e29900241bf58c379.tar
gsoc2013-evolution-00cf33a815541bc2e4a2d96e29900241bf58c379.tar.gz
gsoc2013-evolution-00cf33a815541bc2e4a2d96e29900241bf58c379.tar.bz2
gsoc2013-evolution-00cf33a815541bc2e4a2d96e29900241bf58c379.tar.lz
gsoc2013-evolution-00cf33a815541bc2e4a2d96e29900241bf58c379.tar.xz
gsoc2013-evolution-00cf33a815541bc2e4a2d96e29900241bf58c379.tar.zst
gsoc2013-evolution-00cf33a815541bc2e4a2d96e29900241bf58c379.zip
Bug 582144 – Evolution not showing proper attachment filename
Diffstat (limited to 'widgets/misc/e-attachment.c')
-rw-r--r--widgets/misc/e-attachment.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/widgets/misc/e-attachment.c b/widgets/misc/e-attachment.c
index 67647116e3..e4e336e58b 100644
--- a/widgets/misc/e-attachment.c
+++ b/widgets/misc/e-attachment.c
@@ -2025,16 +2025,18 @@ attachment_open_save_finished_cb (EAttachment *attachment,
static void
attachment_open_save_temporary (OpenContext *open_context)
{
- GFile *file;
+ GFile *temp_directory;
gchar *template;
gchar *path;
GError *error = NULL;
errno = 0;
- /* XXX This could trigger a blocking temp directory cleanup. */
+ /* Save the file to a temporary directory.
+ * We use a directory so the files can retain their basenames.
+ * XXX This could trigger a blocking temp directory cleanup. */
template = g_strdup_printf (PACKAGE "-%s-XXXXXX", g_get_user_name ());
- path = e_mktemp (template);
+ path = e_mkdtemp (template);
g_free (template);
/* XXX Let's hope errno got set properly. */
@@ -2048,15 +2050,15 @@ attachment_open_save_temporary (OpenContext *open_context)
if (attachment_open_check_for_error (open_context, error))
return;
- file = g_file_new_for_path (path);
-
- g_free (path);
+ temp_directory = g_file_new_for_path (path);
e_attachment_save_async (
- open_context->attachment, file, (GAsyncReadyCallback)
+ open_context->attachment,
+ temp_directory, (GAsyncReadyCallback)
attachment_open_save_finished_cb, open_context);
- g_object_unref (file);
+ g_object_unref (temp_directory);
+ g_free (path);
}
void