diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2001-08-25 06:41:24 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2001-08-25 06:41:24 +0800 |
commit | e00591f0081d57618d709e59f6d4a4d671fc2fb0 (patch) | |
tree | 8c68694840ff446e45f5ca24c9eaf901f289a074 /mail/folder-browser.c | |
parent | 7a67b5c2ff35239e7f53fb94896064af9d3c5d17 (diff) | |
download | gsoc2013-evolution-e00591f0081d57618d709e59f6d4a4d671fc2fb0.tar.gz gsoc2013-evolution-e00591f0081d57618d709e59f6d4a4d671fc2fb0.tar.zst gsoc2013-evolution-e00591f0081d57618d709e59f6d4a4d671fc2fb0.zip |
Use the new e_mkdtemp function.
2001-08-24 Jeffrey Stedfast <fejj@ximian.com>
* mail-display.c (launch_cb): Use the new e_mkdtemp function.
* folder-browser.c (message_list_drag_data_get): Use the new
e_mkdtemp function.
svn path=/trunk/; revision=12462
Diffstat (limited to 'mail/folder-browser.c')
-rw-r--r-- | mail/folder-browser.c | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/mail/folder-browser.c b/mail/folder-browser.c index d54c658450..df9155f554 100644 --- a/mail/folder-browser.c +++ b/mail/folder-browser.c @@ -36,6 +36,7 @@ #include "mail-search-dialogue.h" #include "e-util/e-sexp.h" +#include "e-util/e-mktemp.h" #include "folder-browser.h" #include "e-searching-tokenizer.h" #include "mail.h" @@ -216,22 +217,14 @@ message_list_drag_data_get (ETree *tree, int row, ETreePath path, int col, switch (info) { case DND_TARGET_TYPE_TEXT_URI_LIST: { - char *uri_list, *tmpdir, *tmpl; + const char *filename, *tmpdir; CamelMimeMessage *message; - const char *filename; CamelStream *stream; + char *uri_list; int fd; - tmpl = g_strdup ("/tmp/evolution.XXXXXX"); -#ifdef HAVE_MKDTEMP - tmpdir = mkdtemp (tmpl); -#else - tmpdir = mktemp (tmpl); - if (tmpdir) { - if (mkdir (tmpdir, S_IRWXU) == -1) - tmpdir = NULL; - } -#endif + tmpdir = e_mkdtemp ("drag-n-drop-XXXXXX"); + if (!tmpdir) { char *msg = g_strdup_printf (_("Could not create temporary " "directory: %s"), @@ -241,7 +234,6 @@ message_list_drag_data_get (ETree *tree, int row, ETreePath path, int col, for (i = 0; i < uids->len; i++) g_free (uids->pdata[i]); g_ptr_array_free (uids, TRUE); - g_free (tmpl); return; } @@ -257,7 +249,7 @@ message_list_drag_data_get (ETree *tree, int row, ETreePath path, int col, uri_list = g_strdup_printf ("file://%s/%s", tmpdir, filename); - fd = open (uri_list + 7, O_WRONLY | O_CREAT, 0666); + fd = open (uri_list + 7, O_WRONLY | O_CREAT); if (fd == -1) { /* cleanup and abort */ camel_object_unref (CAMEL_OBJECT (message)); |