aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/misc/e-url-entry.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-url-entry.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-url-entry.c')
-rw-r--r--widgets/misc/e-url-entry.c42
1 files changed, 8 insertions, 34 deletions
diff --git a/widgets/misc/e-url-entry.c b/widgets/misc/e-url-entry.c
index 3109f16989..eaefdccddd 100644
--- a/widgets/misc/e-url-entry.c
+++ b/widgets/misc/e-url-entry.c
@@ -34,8 +34,6 @@ struct _EUrlEntryPrivate {
GtkWidget *button;
};
-static void class_init (EUrlEntryClass *class);
-static void init (EUrlEntry *url_entry);
static void finalize (GObject *object);
static void button_clicked_cb (GtkWidget *widget, gpointer data);
@@ -43,42 +41,17 @@ static void entry_changed_cb (GtkEditable *editable, gpointer data);
static gboolean mnemonic_activate (GtkWidget *widget, gboolean group_cycling);
-static gpointer parent_class = NULL;
-
-GType
-e_url_entry_get_type (void)
-{
- static GType type = 0;
-
- if (G_UNLIKELY (type == 0)) {
- static const GTypeInfo type_info = {
- sizeof (EUrlEntryClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) class_init,
- (GClassFinalizeFunc) NULL,
- NULL, /* class_data */
- sizeof (EUrlEntry),
- 0, /* n_preallocs */
- (GInstanceInitFunc) init,
- NULL /* value_table */
- };
-
- type = g_type_register_static (
- GTK_TYPE_HBOX, "EUrlEntry", &type_info, 0);
- }
-
- return type;
-}
+G_DEFINE_TYPE (
+ EUrlEntry,
+ e_url_entry,
+ GTK_TYPE_HBOX)
static void
-class_init (EUrlEntryClass *class)
+e_url_entry_class_init (EUrlEntryClass *class)
{
GObjectClass *object_class;
GtkWidgetClass *widget_class;
- parent_class = g_type_class_peek_parent (class);
-
object_class = G_OBJECT_CLASS (class);
object_class->finalize = finalize;
@@ -87,7 +60,7 @@ class_init (EUrlEntryClass *class)
}
static void
-init (EUrlEntry *url_entry)
+e_url_entry_init (EUrlEntry *url_entry)
{
EUrlEntryPrivate *priv;
GtkWidget *pixmap;
@@ -127,7 +100,8 @@ finalize (GObject *object)
url_entry->priv = NULL;
}
- G_OBJECT_CLASS (parent_class)->finalize (object);
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (e_url_entry_parent_class)->finalize (object);
}
/* GtkWidget::mnemonic_activate() handler for the EUrlEntry */