diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2010-08-24 23:21:41 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2010-08-25 02:37:02 +0800 |
commit | ecf3434da05b1f39f793c24b38bfd278e10b5786 (patch) | |
tree | 485ed2399920ecb10dbee2b4db4c437c22574a20 /widgets/misc/e-image-chooser.c | |
parent | f1d2541c487fbf7433a1b9aad8e8982ef08b85f5 (diff) | |
download | gsoc2013-evolution-ecf3434da05b1f39f793c24b38bfd278e10b5786.tar.gz 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-image-chooser.c')
-rw-r--r-- | widgets/misc/e-image-chooser.c | 37 |
1 files changed, 7 insertions, 30 deletions
diff --git a/widgets/misc/e-image-chooser.c b/widgets/misc/e-image-chooser.c index ed0a9e2327..0ddf08ccde 100644 --- a/widgets/misc/e-image-chooser.c +++ b/widgets/misc/e-image-chooser.c @@ -58,11 +58,15 @@ enum { LAST_SIGNAL }; -static gpointer parent_class; static guint signals[LAST_SIGNAL]; #define URI_LIST_TYPE "text/uri-list" +G_DEFINE_TYPE ( + EImageChooser, + e_image_chooser, + GTK_TYPE_VBOX) + static gboolean set_image_from_data (EImageChooser *chooser, gchar *data, @@ -384,7 +388,7 @@ image_chooser_dispose (GObject *object) } /* Chain up to parent's dispose() method. */ - G_OBJECT_CLASS (parent_class)->dispose (object); + G_OBJECT_CLASS (e_image_chooser_parent_class)->dispose (object); } static void @@ -398,7 +402,7 @@ image_chooser_finalize (GObject *object) g_free (priv->icon_name); /* Chain up to parent's finalize() method. */ - G_OBJECT_CLASS (parent_class)->finalize (object); + G_OBJECT_CLASS (e_image_chooser_parent_class)->finalize (object); } static void @@ -406,7 +410,6 @@ e_image_chooser_class_init (EImageChooserClass *class) { GObjectClass *object_class; - parent_class = g_type_class_peek_parent (class); g_type_class_add_private (class, sizeof (EImageChooserPrivate)); object_class = G_OBJECT_CLASS (class); @@ -482,32 +485,6 @@ e_image_chooser_init (EImageChooser *chooser) G_CALLBACK (image_drag_data_received_cb), chooser); } -GType -e_image_chooser_get_type (void) -{ - static GType type = 0; - - if (G_UNLIKELY (type == 0)) { - static const GTypeInfo type_info = { - sizeof (EImageChooserClass), - (GBaseInitFunc) NULL, - (GBaseFinalizeFunc) NULL, - (GClassInitFunc) e_image_chooser_class_init, - (GClassFinalizeFunc) NULL, - NULL, /* class_data */ - sizeof (EImageChooser), - 0, /* n_preallocs */ - (GInstanceInitFunc) e_image_chooser_init, - NULL /* value_table */ - }; - - type = g_type_register_static ( - GTK_TYPE_VBOX, "EImageChooser", &type_info, 0); - } - - return type; -} - const gchar * e_image_chooser_get_icon_name (EImageChooser *chooser) { |