aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/misc/e-attachment-handler-sendto.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2010-08-24 23:21:41 +0800
committerMatthew Barnes <mbarnes@redhat.com>2010-08-25 02:37:02 +0800
commitecf3434da05b1f39f793c24b38bfd278e10b5786 (patch)
tree485ed2399920ecb10dbee2b4db4c437c22574a20 /widgets/misc/e-attachment-handler-sendto.c
parentf1d2541c487fbf7433a1b9aad8e8982ef08b85f5 (diff)
downloadgsoc2013-evolution-ecf3434da05b1f39f793c24b38bfd278e10b5786.tar
gsoc2013-evolution-ecf3434da05b1f39f793c24b38bfd278e10b5786.tar.gz
gsoc2013-evolution-ecf3434da05b1f39f793c24b38bfd278e10b5786.tar.bz2
gsoc2013-evolution-ecf3434da05b1f39f793c24b38bfd278e10b5786.tar.lz
gsoc2013-evolution-ecf3434da05b1f39f793c24b38bfd278e10b5786.tar.xz
gsoc2013-evolution-ecf3434da05b1f39f793c24b38bfd278e10b5786.tar.zst
gsoc2013-evolution-ecf3434da05b1f39f793c24b38bfd278e10b5786.zip
GObject boilerplate cleanup.
Prefer thread-safe G_DEFINE_TYPE and G_DEFINE_INTERFACE macros over manual GType registration. This is just a start... lots more to do.
Diffstat (limited to 'widgets/misc/e-attachment-handler-sendto.c')
-rw-r--r--widgets/misc/e-attachment-handler-sendto.c41
1 files changed, 10 insertions, 31 deletions
diff --git a/widgets/misc/e-attachment-handler-sendto.c b/widgets/misc/e-attachment-handler-sendto.c
index dda351bc8d..a508314705 100644
--- a/widgets/misc/e-attachment-handler-sendto.c
+++ b/widgets/misc/e-attachment-handler-sendto.c
@@ -25,8 +25,6 @@
#include <glib/gi18n-lib.h>
-static gpointer parent_class;
-
static const gchar *ui =
"<ui>"
" <popup name='context'>"
@@ -36,6 +34,11 @@ static const gchar *ui =
" </popup>"
"</ui>";
+G_DEFINE_TYPE (
+ EAttachmentHandlerSendto,
+ e_attachment_handler_sendto,
+ E_TYPE_ATTACHMENT_HANDLER)
+
static void
sendto_save_finished_cb (EAttachment *attachment,
GAsyncResult *result,
@@ -182,7 +185,8 @@ attachment_handler_sendto_constructed (GObject *object)
handler = E_ATTACHMENT_HANDLER (object);
/* Chain up to parent's constructed() method. */
- G_OBJECT_CLASS (parent_class)->constructed (object);
+ G_OBJECT_CLASS (e_attachment_handler_sendto_parent_class)->
+ constructed (object);
view = e_attachment_handler_get_view (handler);
ui_manager = e_attachment_view_get_ui_manager (view);
@@ -209,40 +213,15 @@ attachment_handler_sendto_constructed (GObject *object)
}
static void
-attachment_handler_sendto_class_init (EAttachmentHandlerSendtoClass *class)
+e_attachment_handler_sendto_class_init (EAttachmentHandlerSendtoClass *class)
{
GObjectClass *object_class;
- parent_class = g_type_class_peek_parent (class);
-
object_class = G_OBJECT_CLASS (class);
object_class->constructed = attachment_handler_sendto_constructed;
}
-GType
-e_attachment_handler_sendto_get_type (void)
+static void
+e_attachment_handler_sendto_init (EAttachmentHandlerSendto *handler)
{
- static GType type = 0;
-
- if (G_UNLIKELY (type == 0)) {
- static const GTypeInfo type_info = {
- sizeof (EAttachmentHandlerSendtoClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) attachment_handler_sendto_class_init,
- (GClassFinalizeFunc) NULL,
- NULL, /* class_data */
- sizeof (EAttachmentHandlerSendto),
- 0, /* n_preallocs */
- (GInstanceInitFunc) NULL,
- NULL /* value_table */
- };
-
- type = g_type_register_static (
- E_TYPE_ATTACHMENT_HANDLER,
- "EAttachmentHandlerSendto",
- &type_info, 0);
- }
-
- return type;
}