aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRadek Doulik <rodo@ximian.com>2002-03-09 07:35:01 +0800
committerRadek Doulik <rodo@src.gnome.org>2002-03-09 07:35:01 +0800
commit03ec14c7df002279d949b84be4f0f68e45816726 (patch)
tree40a20153fa38aaa1855571901e86f6c35d8ddddf
parent20a28f53fc442fd51d0abaf45d1066cc42aa3885 (diff)
downloadgsoc2013-evolution-03ec14c7df002279d949b84be4f0f68e45816726.tar.gz
gsoc2013-evolution-03ec14c7df002279d949b84be4f0f68e45816726.tar.zst
gsoc2013-evolution-03ec14c7df002279d949b84be4f0f68e45816726.zip
truncate stream before saving
2002-03-08 Radek Doulik <rodo@ximian.com> * mail-signature-editor.c (menu_file_save_cb): truncate stream before saving svn path=/trunk/; revision=15997
-rw-r--r--mail/ChangeLog3
-rw-r--r--mail/mail-signature-editor.c5
2 files changed, 6 insertions, 2 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 094adad125..5caa25df2b 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,5 +1,8 @@
2002-03-08 Radek Doulik <rodo@ximian.com>
+ * mail-signature-editor.c (menu_file_save_cb): truncate stream
+ before saving
+
* mail-config.c (mail_config_signature_set_html): new function
* mail-accounts.c (sig_event_client): watch for HTML changed event
diff --git a/mail/mail-signature-editor.c b/mail/mail-signature-editor.c
index b68e13b84d..04f5da7ef4 100644
--- a/mail/mail-signature-editor.c
+++ b/mail/mail-signature-editor.c
@@ -76,7 +76,8 @@ menu_file_save_cb (BonoboUIComponent *uic,
CORBA_exception_init (&ev);
stream = bonobo_stream_open (BONOBO_IO_DRIVER_FS, editor->sig->filename,
- Bonobo_Storage_WRITE | Bonobo_Storage_CREATE, 0);
+ Bonobo_Storage_CREATE, 0);
+ BONOBO_STREAM_CLASS (GTK_OBJECT (stream)->klass)->truncate (stream, 0, &ev);
pstream_iface = bonobo_object_client_query_interface
(bonobo_widget_get_server (BONOBO_WIDGET (editor->control)),
@@ -92,8 +93,8 @@ menu_file_save_cb (BonoboUIComponent *uic,
CORBA_exception_free (&ev);
bonobo_object_unref (BONOBO_OBJECT (stream));
}
- editor->sig->html = editor->html;
+ mail_config_signature_set_html (editor->sig, editor->html);
mail_config_signature_emit_event (MAIL_CONFIG_SIG_EVENT_CONTENT_CHANGED, editor->sig);
}