aboutsummaryrefslogtreecommitdiffstats
path: root/widgets
diff options
context:
space:
mode:
authorTor Lillqvist <tml@novell.com>2005-12-18 17:46:32 +0800
committerTor Lillqvist <tml@src.gnome.org>2005-12-18 17:46:32 +0800
commit0ff898adb4dd311f7b1c34ece1b4717ea3d513eb (patch)
tree944bfabc6e8ca9946676d33d92650da0e223a86a /widgets
parent480464c381ad3c2e4d07ed79d933301d839778a6 (diff)
downloadgsoc2013-evolution-0ff898adb4dd311f7b1c34ece1b4717ea3d513eb.tar
gsoc2013-evolution-0ff898adb4dd311f7b1c34ece1b4717ea3d513eb.tar.gz
gsoc2013-evolution-0ff898adb4dd311f7b1c34ece1b4717ea3d513eb.tar.bz2
gsoc2013-evolution-0ff898adb4dd311f7b1c34ece1b4717ea3d513eb.tar.lz
gsoc2013-evolution-0ff898adb4dd311f7b1c34ece1b4717ea3d513eb.tar.xz
gsoc2013-evolution-0ff898adb4dd311f7b1c34ece1b4717ea3d513eb.tar.zst
gsoc2013-evolution-0ff898adb4dd311f7b1c34ece1b4717ea3d513eb.zip
Use gstdio wrappers. Construct glade file name at run-time.
2005-12-18 Tor Lillqvist <tml@novell.com> * e-attachment.c: Use gstdio wrappers. Construct glade file name at run-time. svn path=/trunk/; revision=30864
Diffstat (limited to 'widgets')
-rw-r--r--widgets/misc/ChangeLog3
-rw-r--r--widgets/misc/e-attachment.c29
2 files changed, 29 insertions, 3 deletions
diff --git a/widgets/misc/ChangeLog b/widgets/misc/ChangeLog
index 3e30dfc393..98eb6178d0 100644
--- a/widgets/misc/ChangeLog
+++ b/widgets/misc/ChangeLog
@@ -6,6 +6,9 @@
instead of privlib (no difference on Unix). Use -no-undefined on
Win32. Link with all required libraries.
+ * e-attachment.c: Use gstdio wrappers. Construct glade file name
+ at run-time.
+
2005-12-15 Srinivasa Ragavan <sragavan@novell.com>
* e-filter-bar.c: (rule_advanced_response), (option_changed),
diff --git a/widgets/misc/e-attachment.c b/widgets/misc/e-attachment.c
index e5a37bcdc4..e0eb1b9e02 100644
--- a/widgets/misc/e-attachment.c
+++ b/widgets/misc/e-attachment.c
@@ -26,6 +26,21 @@
#include <config.h>
#endif
+#include <glib.h>
+
+#ifdef G_OS_WIN32
+/* Include <windows.h> early (as the gnome-vfs stuff below will
+ * include it anyway, sigh) to workaround the DATADIR problem.
+ * <windows.h> (and the headers it includes) stomps all over the
+ * namespace like a baboon on crack, and especially the DATADIR enum
+ * in objidl.h causes problems.
+ */
+#undef DATADIR
+#define DATADIR crap_DATADIR
+#include <windows.h>
+#undef DATADIR
+#endif
+
#include <sys/stat.h>
#include <string.h>
#include <errno.h>
@@ -37,8 +52,10 @@
#include <gtk/gtkdialog.h>
#include <libgnomevfs/gnome-vfs-mime.h>
#include <libgnome/gnome-i18n.h>
+#include <glib/gstdio.h>
#include "e-util/e-mktemp.h"
+#include "e-util/e-util-private.h"
#include "e-attachment.h"
@@ -216,7 +233,7 @@ e_attachment_new (const char *file_name,
g_return_val_if_fail (file_name != NULL, NULL);
- if (stat (file_name, &statbuf) < 0) {
+ if (g_stat (file_name, &statbuf) < 0) {
camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
_("Cannot attach file %s: %s"),
file_name, g_strerror (errno));
@@ -420,7 +437,7 @@ e_attachment_build_remote_file (const char *file_name,
g_return_if_fail (file_name != NULL);
- if (stat (file_name, &statbuf) < 0) {
+ if (g_stat (file_name, &statbuf) < 0) {
camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
_("Cannot attach file %s: %s"),
file_name, g_strerror (errno));
@@ -655,6 +672,7 @@ e_attachment_edit (EAttachment *attachment, GtkWidget *parent)
DialogData *dialog_data;
GladeXML *editor_gui;
char *type;
+ char *filename;
g_return_if_fail (attachment != NULL);
g_return_if_fail (E_IS_ATTACHMENT (attachment));
@@ -668,8 +686,13 @@ e_attachment_edit (EAttachment *attachment, GtkWidget *parent)
return;
}
- editor_gui = glade_xml_new (EVOLUTION_GLADEDIR "/e-attachment.glade",
+ filename = g_build_filename (EVOLUTION_GLADEDIR,
+ "e-attachment.glade",
+ NULL);
+ editor_gui = glade_xml_new (filename,
NULL, NULL);
+ g_free (filename);
+
if (editor_gui == NULL) {
g_warning ("Cannot load `e-attachment.glade'");
return;