aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/misc/e-signature-tree-view.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-signature-tree-view.c
parentf1d2541c487fbf7433a1b9aad8e8982ef08b85f5 (diff)
downloadgsoc2013-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-signature-tree-view.c')
-rw-r--r--widgets/misc/e-signature-tree-view.c45
1 files changed, 11 insertions, 34 deletions
diff --git a/widgets/misc/e-signature-tree-view.c b/widgets/misc/e-signature-tree-view.c
index 5c931c8d93..9d27ec1929 100644
--- a/widgets/misc/e-signature-tree-view.c
+++ b/widgets/misc/e-signature-tree-view.c
@@ -46,9 +46,13 @@ struct _ESignatureTreeViewPrivate {
GHashTable *index;
};
-static gpointer parent_class;
static guint signals[LAST_SIGNAL];
+G_DEFINE_TYPE (
+ ESignatureTreeView,
+ e_signature_tree_view,
+ GTK_TYPE_TREE_VIEW)
+
static void
signature_tree_view_refresh_cb (ESignatureList *signature_list,
ESignature *unused,
@@ -141,7 +145,8 @@ signature_tree_view_constructor (GType type,
GtkCellRenderer *renderer;
/* Chain up to parent's constructor() method. */
- object = G_OBJECT_CLASS (parent_class)->constructor (
+ object = G_OBJECT_CLASS (
+ e_signature_tree_view_parent_class)->constructor (
type, n_construct_properties, construct_properties);
tree_view = GTK_TREE_VIEW (object);
@@ -223,7 +228,7 @@ signature_tree_view_dispose (GObject *object)
g_hash_table_remove_all (priv->index);
/* Chain up to parent's dispose() method. */
- G_OBJECT_CLASS (parent_class)->dispose (object);
+ G_OBJECT_CLASS (e_signature_tree_view_parent_class)->dispose (object);
}
static void
@@ -236,15 +241,14 @@ signature_tree_view_finalize (GObject *object)
g_hash_table_destroy (priv->index);
/* Chain up to parent's finalize() method. */
- G_OBJECT_CLASS (parent_class)->finalize (object);
+ G_OBJECT_CLASS (e_signature_tree_view_parent_class)->finalize (object);
}
static void
-signature_tree_view_class_init (ESignatureTreeViewClass *class)
+e_signature_tree_view_class_init (ESignatureTreeViewClass *class)
{
GObjectClass *object_class;
- parent_class = g_type_class_peek_parent (class);
g_type_class_add_private (class, sizeof (ESignatureTreeViewPrivate));
object_class = G_OBJECT_CLASS (class);
@@ -285,7 +289,7 @@ signature_tree_view_class_init (ESignatureTreeViewClass *class)
}
static void
-signature_tree_view_init (ESignatureTreeView *tree_view)
+e_signature_tree_view_init (ESignatureTreeView *tree_view)
{
GHashTable *index;
GtkTreeSelection *selection;
@@ -307,33 +311,6 @@ signature_tree_view_init (ESignatureTreeView *tree_view)
tree_view);
}
-GType
-e_signature_tree_view_get_type (void)
-{
- static GType type = 0;
-
- if (G_UNLIKELY (type == 0)) {
- static const GTypeInfo type_info = {
- sizeof (ESignatureTreeViewClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) signature_tree_view_class_init,
- (GClassFinalizeFunc) NULL,
- NULL, /* class_data */
- sizeof (ESignatureTreeView),
- 0, /* n_preallocs */
- (GInstanceInitFunc) signature_tree_view_init,
- NULL /* value_table */
- };
-
- type = g_type_register_static (
- GTK_TYPE_TREE_VIEW, "ESignatureTreeView",
- &type_info, 0);
- }
-
- return type;
-}
-
GtkWidget *
e_signature_tree_view_new (void)
{