From 0d3ef53bd7c1d7d96906f0f8348151a453e79078 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Mon, 27 Apr 2009 15:36:19 -0400 Subject: Commit the rest of the attachment UI rewrite Oops, last commit only included the -new- files. This also removes EExpander, which is no longer used. --- e-util/e-util.c | 30 ++++++++++++++++++++++++++++++ e-util/e-util.h | 5 +++++ 2 files changed, 35 insertions(+) (limited to 'e-util') diff --git a/e-util/e-util.c b/e-util/e-util.c index 071f5e58b8..04be119657 100644 --- a/e-util/e-util.c +++ b/e-util/e-util.c @@ -1531,3 +1531,33 @@ e_camel_object_get_type (void) return type; } + +static gpointer +e_camel_object_copy (gpointer camel_object) +{ + if (CAMEL_IS_OBJECT (camel_object)) + camel_object_ref (camel_object); + + return camel_object; +} + +static void +e_camel_object_free (gpointer camel_object) +{ + if (CAMEL_IS_OBJECT (camel_object)) + camel_object_unref (camel_object); +} + +GType +e_camel_object_get_type (void) +{ + static GType type = 0; + + if (G_UNLIKELY (type == 0)) + type = g_boxed_type_register_static ( + "ECamelObject", + (GBoxedCopyFunc) e_camel_object_copy, + (GBoxedFreeFunc) e_camel_object_free); + + return type; +} diff --git a/e-util/e-util.h b/e-util/e-util.h index 84ec411516..34ef3466d3 100644 --- a/e-util/e-util.h +++ b/e-util/e-util.h @@ -146,6 +146,11 @@ gboolean e_util_read_file (const gchar *filename, #define E_TYPE_CAMEL_OBJECT (e_camel_object_get_type ()) GType e_camel_object_get_type (void); +/* Camel uses its own object system, so we have to box + * CamelObjects to safely use them as GObject properties. */ +#define E_TYPE_CAMEL_OBJECT (e_camel_object_get_type ()) +GType e_camel_object_get_type (void); + G_END_DECLS #endif /* _E_UTIL_H_ */ -- cgit v1.2.3