#include <libgnomevfs/gnome-vfs.h>
#include <libgnomevfs/gnome-vfs-mime-handlers.h>
#include <libgnomevfs/gnome-vfs-mime-utils.h>
+#include "ev-file-helpers.h"
#include "ev-attachment.h"
enum
g_return_val_if_fail (uri != NULL, FALSE);
result = gnome_vfs_create (&handle, uri,
- GNOME_VFS_OPEN_WRITE |
- GNOME_VFS_OPEN_TRUNCATE,
+ GNOME_VFS_OPEN_WRITE,
FALSE, 0644);
if (result != GNOME_VFS_OK) {
g_set_error (error,
EV_ATTACHMENT_ERROR,
(gint) result,
- _("Couldn't save attachment '%s': %s"),
+ _("Couldn't save attachment “%s”: %s"),
uri,
gnome_vfs_result_to_string (result));
g_set_error (error,
EV_ATTACHMENT_ERROR,
(gint) result,
- _("Couldn't save attachment '%s': %s"),
+ _("Couldn't save attachment “%s”: %s"),
uri,
gnome_vfs_result_to_string (result));
g_set_error (error,
EV_ATTACHMENT_ERROR,
(gint) result,
- _("Couldn't open attachment '%s': %s"),
+ _("Couldn't open attachment “%s”: %s"),
attachment->priv->name,
gnome_vfs_result_to_string (result));
g_set_error (error,
EV_ATTACHMENT_ERROR,
0,
- _("Couldn't open attachment '%s'"),
+ _("Couldn't open attachment “%s”"),
attachment->priv->name);
return FALSE;
} else {
gchar *uri, *filename;
- filename = g_build_filename (g_get_tmp_dir (), attachment->priv->name, NULL);
+ filename = g_build_filename (ev_tmp_dir (), attachment->priv->name, NULL);
uri = g_filename_to_uri (filename, NULL, NULL);
if (ev_attachment_save (attachment, uri, error)) {