aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/misc/e-attachment-handler-image.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-image.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-image.c')
-rw-r--r--widgets/misc/e-attachment-handler-image.c43
1 files changed, 9 insertions, 34 deletions
diff --git a/widgets/misc/e-attachment-handler-image.c b/widgets/misc/e-attachment-handler-image.c
index 770b1c552b..2aedaa6023 100644
--- a/widgets/misc/e-attachment-handler-image.c
+++ b/widgets/misc/e-attachment-handler-image.c
@@ -34,8 +34,6 @@ struct _EAttachmentHandlerImagePrivate {
gint placeholder;
};
-static gpointer parent_class;
-
static const gchar *ui =
"<ui>"
" <popup name='context'>"
@@ -45,6 +43,11 @@ static const gchar *ui =
" </popup>"
"</ui>";
+G_DEFINE_TYPE (
+ EAttachmentHandlerImage,
+ e_attachment_handler_image,
+ E_TYPE_ATTACHMENT_HANDLER)
+
static void
action_image_set_as_background_saved_cb (EAttachment *attachment,
GAsyncResult *result,
@@ -207,7 +210,8 @@ attachment_handler_image_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_image_parent_class)->
+ constructed (object);
view = e_attachment_handler_get_view (handler);
@@ -231,11 +235,10 @@ attachment_handler_image_constructed (GObject *object)
}
static void
-attachment_handler_image_class_init (EAttachmentHandlerImageClass *class)
+e_attachment_handler_image_class_init (EAttachmentHandlerImageClass *class)
{
GObjectClass *object_class;
- parent_class = g_type_class_peek_parent (class);
g_type_class_add_private (class, sizeof (EAttachmentHandlerImagePrivate));
object_class = G_OBJECT_CLASS (class);
@@ -243,35 +246,7 @@ attachment_handler_image_class_init (EAttachmentHandlerImageClass *class)
}
static void
-attachment_handler_image_init (EAttachmentHandlerImage *handler)
+e_attachment_handler_image_init (EAttachmentHandlerImage *handler)
{
handler->priv = E_ATTACHMENT_HANDLER_IMAGE_GET_PRIVATE (handler);
}
-
-GType
-e_attachment_handler_image_get_type (void)
-{
- static GType type = 0;
-
- if (G_UNLIKELY (type == 0)) {
- static const GTypeInfo type_info = {
- sizeof (EAttachmentHandlerImageClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) attachment_handler_image_class_init,
- (GClassFinalizeFunc) NULL,
- NULL, /* class_data */
- sizeof (EAttachmentHandlerImage),
- 0, /* n_preallocs */
- (GInstanceInitFunc) attachment_handler_image_init,
- NULL /* value_table */
- };
-
- type = g_type_register_static (
- E_TYPE_ATTACHMENT_HANDLER,
- "EAttachmentHandlerImage",
- &type_info, 0);
- }
-
- return type;
-}