aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--widgets/misc/e-attachment-store.c5
-rw-r--r--widgets/misc/e-attachment.c18
2 files changed, 14 insertions, 9 deletions
diff --git a/widgets/misc/e-attachment-store.c b/widgets/misc/e-attachment-store.c
index 9d0fe6d21e..53a1cbe1ff 100644
--- a/widgets/misc/e-attachment-store.c
+++ b/widgets/misc/e-attachment-store.c
@@ -839,11 +839,13 @@ e_attachment_store_get_uris_async (EAttachmentStore *store,
/* Any remaining attachments in the list should have MIME parts
* only, so we need to save them all to a temporary directory.
- * We use a directory so the files can retain their basenames. */
+ * 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_mkdtemp (template);
g_free (template);
+ /* XXX Let's hope errno got set property. */
if (path == NULL) {
GSimpleAsyncResult *simple;
@@ -871,6 +873,7 @@ e_attachment_store_get_uris_async (EAttachmentStore *store,
uri_context);
g_object_unref (temp_directory);
+ g_free (path);
}
gchar **
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
>/+5 * KDE/FreeBSD team presents KDE SC 4.8.4, probably the last release in 4.8.x se...makc2012-06-152-3/+2 * - update png to 1.5.10dinoex2012-06-011-0/+1 * KDE/FreeBSD team presents long awaited KDE SC 4.8.3!makc2012-05-253-25/+19 * - Bump PORTREVISION to chase the update of multimedia/libvpxashish2012-02-161-0/+1 * The KDE/FreeBSD team is pleased to announce KDE SC 4.7.4, whichavilla2012-01-252-2/+18 * The KDE on FreeBSD team is pleased to update the KDE4 ports to 4.7.3.rakuco2011-11-141-2/+2 * The KDE/FreeBSD team is pleased to announce KDE Software Compilationavilla2011-10-17