aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-ops.c
diff options
context:
space:
mode:
authorSrinivasa Ragavan <sragavan@src.gnome.org>2006-05-25 14:04:48 +0800
committerSrinivasa Ragavan <sragavan@src.gnome.org>2006-05-25 14:04:48 +0800
commit24368cf92dd5eaae1b41b3f191a25e2cbc45e824 (patch)
treef250be111bc4afa6440414ada53ff051bb30ff0d /mail/mail-ops.c
parent0fdf8a120ccb5638527293f6155d0e16af571732 (diff)
downloadgsoc2013-evolution-24368cf92dd5eaae1b41b3f191a25e2cbc45e824.tar.gz
gsoc2013-evolution-24368cf92dd5eaae1b41b3f191a25e2cbc45e824.tar.zst
gsoc2013-evolution-24368cf92dd5eaae1b41b3f191a25e2cbc45e824.zip
Added code to save/attach files/mails/events to/from remote shares
svn path=/trunk/; revision=32023
Diffstat (limited to 'mail/mail-ops.c')
-rw-r--r--mail/mail-ops.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/mail/mail-ops.c b/mail/mail-ops.c
index 23dc550e0a..5c8c97e2fd 100644
--- a/mail/mail-ops.c
+++ b/mail/mail-ops.c
@@ -41,6 +41,7 @@
#include <camel/camel-mime-filter-from.h>
#include <camel/camel-stream-filter.h>
#include <camel/camel-stream-fs.h>
+#include <camel/camel-stream-vfs.h>
#include <camel/camel-mime-filter-charset.h>
#include <camel/camel-offline-folder.h>
#include <camel/camel-offline-store.h>
@@ -1985,14 +1986,7 @@ save_messages_save (struct _mail_msg *mm)
int fd, i;
char *from;
- fd = g_open (m->path, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0666);
- if (fd == -1) {
- camel_exception_setv(&mm->ex, CAMEL_EXCEPTION_SYSTEM,
- _("Unable to create output file: %s\n %s"), m->path, strerror(errno));
- return;
- }
-
- stream = camel_stream_fs_new_with_fd(fd);
+ stream = camel_stream_vfs_new_with_uri (m->path, O_WRONLY | O_CREAT | O_TRUNC, 0666);
from_filter = camel_mime_filter_from_new();
filtered_stream = camel_stream_filter_new_with_stream(stream);
camel_stream_filter_add(filtered_stream, (CamelMimeFilter *)from_filter);
@@ -2099,13 +2093,13 @@ save_part_save (struct _mail_msg *mm)
CamelStream *stream;
if(!m->readonly){
- if (!(stream = camel_stream_fs_new_with_name (m->path, O_WRONLY | O_CREAT | O_TRUNC, 0666))) {
+ if (!(stream = camel_stream_vfs_new_with_uri (m->path, O_WRONLY | O_CREAT | O_TRUNC, 0666))) {
camel_exception_setv (&mm->ex, CAMEL_EXCEPTION_SYSTEM,
_("Cannot create output file: %s:\n %s"),
m->path, g_strerror (errno));
return;
}
- } else if (!(stream = camel_stream_fs_new_with_name (m->path, O_WRONLY | O_CREAT | O_TRUNC, 0444))) {
+ } else if (!(stream = camel_stream_vfs_new_with_uri (m->path, O_WRONLY | O_CREAT | O_TRUNC, 0444))) {
camel_exception_setv (&mm->ex, CAMEL_EXCEPTION_SYSTEM,
_("Cannot create output file: %s:\n %s"),
m->path, g_strerror (errno));