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-signature-script-dialog.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-signature-script-dialog.c')
-rw-r--r-- | widgets/misc/e-signature-script-dialog.c | 41 |
1 files changed, 8 insertions, 33 deletions
diff --git a/widgets/misc/e-signature-script-dialog.c b/widgets/misc/e-signature-script-dialog.c index 777d064f09..d6f48233c2 100644 --- a/widgets/misc/e-signature-script-dialog.c +++ b/widgets/misc/e-signature-script-dialog.c @@ -40,7 +40,10 @@ enum { PROP_SCRIPT_NAME }; -static gpointer parent_class; +G_DEFINE_TYPE ( + ESignatureScriptDialog, + e_signature_script_dialog, + GTK_TYPE_DIALOG) static gboolean signature_script_dialog_filter_cb (const GtkFileFilterInfo *filter_info) @@ -160,7 +163,7 @@ signature_script_dialog_dispose (GObject *object) } /* Chain up to parent's dispose() method. */ - G_OBJECT_CLASS (parent_class)->dispose (object); + G_OBJECT_CLASS (e_signature_script_dialog_parent_class)->dispose (object); } static void @@ -170,7 +173,7 @@ signature_script_dialog_map (GtkWidget *widget) GtkWidget *content_area; /* Chain up to parent's map() method. */ - GTK_WIDGET_CLASS (parent_class)->map (widget); + GTK_WIDGET_CLASS (e_signature_script_dialog_parent_class)->map (widget); /* XXX Override GtkDialog's broken style property defaults. */ action_area = gtk_dialog_get_action_area (GTK_DIALOG (widget)); @@ -182,12 +185,11 @@ signature_script_dialog_map (GtkWidget *widget) } static void -signature_script_dialog_class_init (ESignatureScriptDialogClass *class) +e_signature_script_dialog_class_init (ESignatureScriptDialogClass *class) { GObjectClass *object_class; GtkWidgetClass *widget_class; - parent_class = g_type_class_peek_parent (class); g_type_class_add_private (class, sizeof (ESignatureScriptDialogPrivate)); object_class = G_OBJECT_CLASS (class); @@ -221,7 +223,7 @@ signature_script_dialog_class_init (ESignatureScriptDialogClass *class) } static void -signature_script_dialog_init (ESignatureScriptDialog *dialog) +e_signature_script_dialog_init (ESignatureScriptDialog *dialog) { GtkFileFilter *filter; GtkWidget *content_area; @@ -366,33 +368,6 @@ signature_script_dialog_init (ESignatureScriptDialog *dialog) signature_script_dialog_update_status (dialog); } -GType -e_signature_script_dialog_get_type (void) -{ - static GType type = 0; - - if (G_UNLIKELY (type == 0)) { - static const GTypeInfo type_info = { - sizeof (ESignatureScriptDialogClass), - (GBaseInitFunc) NULL, - (GBaseFinalizeFunc) NULL, - (GClassInitFunc) signature_script_dialog_class_init, - (GClassFinalizeFunc) NULL, - NULL, /* class_data */ - sizeof (ESignatureScriptDialog), - 0, /* n_preallocs */ - (GInstanceInitFunc) signature_script_dialog_init, - NULL /* value_table */ - }; - - type = g_type_register_static ( - GTK_TYPE_DIALOG, "ESignatureScriptDialog", - &type_info, 0); - } - - return type; -} - GtkWidget * e_signature_script_dialog_new (GtkWindow *parent) { |