aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Lillqvist <tml@novell.com>2005-12-18 01:45:33 +0800
committerTor Lillqvist <tml@src.gnome.org>2005-12-18 01:45:33 +0800
commit92b09e3c84de02c693bb38fba4bb18ddab52ad61 (patch)
tree3cafffeda4d5c175e846ae12c8bbe728e8aa533c
parent9093a7c17246117f5c71176d2018e740462cdea0 (diff)
downloadgsoc2013-evolution-92b09e3c84de02c693bb38fba4bb18ddab52ad61.tar.gz
gsoc2013-evolution-92b09e3c84de02c693bb38fba4bb18ddab52ad61.tar.zst
gsoc2013-evolution-92b09e3c84de02c693bb38fba4bb18ddab52ad61.zip
Use gstdio wrappers. Construct UI XML file pathname at run-time.
2005-12-13 Tor Lillqvist <tml@novell.com> * mail-signature-editor.c: Use gstdio wrappers. Construct UI XML file pathname at run-time. svn path=/trunk/; revision=30838
-rw-r--r--mail/ChangeLog3
-rw-r--r--mail/mail-signature-editor.c22
2 files changed, 18 insertions, 7 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index bbd5e8293b..4159a4a835 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -17,6 +17,9 @@
* mail-ops.c: Use gstdio wrappers. Open file in binary mode.
+ * mail-signature-editor.c: Use gstdio wrappers. Construct UI XML
+ file pathname at run-time.
+
2005-12-12 Karsten Bräckelmann <guenther@rudersport.de>
* em-folder-view.c: Mail Context Menu re-ordered correctly,
diff --git a/mail/mail-signature-editor.c b/mail/mail-signature-editor.c
index 8ee79f9243..eba4bf0bef 100644
--- a/mail/mail-signature-editor.c
+++ b/mail/mail-signature-editor.c
@@ -21,9 +21,7 @@
*
*/
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
#include <string.h>
#include <sys/types.h>
@@ -31,13 +29,17 @@
#include <fcntl.h>
#include <errno.h>
+#include <glib.h>
+#include <glib/gstdio.h>
+
#include <gtk/gtk.h>
#include <bonobo.h>
#include <bonobo/bonobo-stream-memory.h>
-#include <e-util/e-signature-list.h>
#include "e-util/e-error.h"
+#include "e-util/e-signature-list.h"
+#include "e-util/e-util-private.h"
#include "e-msg-composer.h"
#include "mail-signature-editor.h"
@@ -161,7 +163,7 @@ menu_file_save_cb (BonoboUIComponent *uic, void *user_data, const char *path)
if (ev._major != CORBA_NO_EXCEPTION)
goto exception;
- if ((fd = open (filename, O_WRONLY | O_TRUNC | O_CREAT, 0666)) == -1)
+ if ((fd = g_open (filename, O_WRONLY | O_TRUNC | O_CREAT, 0666)) == -1)
goto exception;
text = get_text (pstream_iface, editor->html ? "text/html" : "text/plain", &ev);
@@ -179,7 +181,7 @@ menu_file_save_cb (BonoboUIComponent *uic, void *user_data, const char *path)
g_byte_array_free (text, TRUE);
close (fd);
- if (rename (filename, editor->sig->filename) == -1)
+ if (g_rename (filename, editor->sig->filename) == -1)
goto exception;
g_free (filename);
@@ -218,7 +220,7 @@ menu_file_save_cb (BonoboUIComponent *uic, void *user_data, const char *path)
exception:
menu_file_save_error (uic, &ev);
CORBA_exception_free (&ev);
- unlink (filename);
+ g_unlink (filename);
g_free (filename);
}
@@ -368,6 +370,7 @@ mail_signature_editor (ESignature *sig, GtkWindow *parent, gboolean is_new)
BonoboUIComponent *component;
BonoboUIContainer *container;
GtkWidget *vbox, *hbox, *label, *frame, *vbox1;
+ char *xmlfile;
if (!sig->filename || !*sig->filename)
return;
@@ -392,9 +395,14 @@ mail_signature_editor (ESignature *sig, GtkWindow *parent, gboolean is_new)
component = bonobo_ui_component_new_default ();
bonobo_ui_component_set_container (component, bonobo_object_corba_objref (BONOBO_OBJECT (container)), NULL);
bonobo_ui_component_add_verb_list_with_data (component, verbs, editor);
+
+ xmlfile = g_build_filename (EVOLUTION_UIDIR,
+ "evolution-signature-editor.xml",
+ NULL);
bonobo_ui_util_set_ui (component, PREFIX,
- EVOLUTION_UIDIR "/evolution-signature-editor.xml",
+ xmlfile,
"evolution-signature-editor", NULL);
+ g_free (xmlfile);
editor->control = bonobo_widget_new_control (GNOME_GTKHTML_EDITOR_CONTROL_ID,
bonobo_ui_component_get_container (component));