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 /filter/e-filter-part.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 'filter/e-filter-part.c')
-rw-r--r-- | filter/e-filter-part.c | 36 |
1 files changed, 8 insertions, 28 deletions
diff --git a/filter/e-filter-part.c b/filter/e-filter-part.c index 4e6b114c37..2b75b30235 100644 --- a/filter/e-filter-part.c +++ b/filter/e-filter-part.c @@ -35,7 +35,10 @@ #include "e-filter-part.h" #include "e-rule-context.h" -static gpointer parent_class; +G_DEFINE_TYPE ( + EFilterPart, + e_filter_part, + G_TYPE_OBJECT) static void filter_part_finalize (GObject *object) @@ -50,44 +53,21 @@ filter_part_finalize (GObject *object) g_free (part->code); /* Chain up to parent's finalize() method. */ - G_OBJECT_CLASS (parent_class)->finalize (object); + G_OBJECT_CLASS (e_filter_part_parent_class)->finalize (object); } static void -filter_part_class_init (EFilterPartClass *class) +e_filter_part_class_init (EFilterPartClass *class) { GObjectClass *object_class; - parent_class = g_type_class_peek_parent (class); - object_class = G_OBJECT_CLASS (class); object_class->finalize = filter_part_finalize; } -GType -e_filter_part_get_type (void) +static void +e_filter_part_init (EFilterPart *part) { - static GType type = 0; - - if (G_UNLIKELY (type == 0)) { - static const GTypeInfo type_info = { - sizeof (EFilterPartClass), - (GBaseInitFunc) NULL, - (GBaseFinalizeFunc) NULL, - (GClassInitFunc) filter_part_class_init, - (GClassFinalizeFunc) NULL, - NULL, /* class_data */ - sizeof (EFilterPart), - 0, /* n_preallocs */ - (GInstanceInitFunc) NULL, - NULL /* value_table */ - }; - - type = g_type_register_static ( - G_TYPE_OBJECT, "EFilterPart", &type_info, 0); - } - - return type; } /** |