aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/misc/e-attachment-dialog.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-attachment-dialog.c
parentf1d2541c487fbf7433a1b9aad8e8982ef08b85f5 (diff)
downloadgsoc2013-evolution-ecf3434da05b1f39f793c24b38bfd278e10b5786.tar
gsoc2013-evolution-ecf3434da05b1f39f793c24b38bfd278e10b5786.tar.gz
gsoc2013-evolution-ecf3434da05b1f39f793c24b38bfd278e10b5786.tar.bz2
gsoc2013-evolution-ecf3434da05b1f39f793c24b38bfd278e10b5786.tar.lz
gsoc2013-evolution-ecf3434da05b1f39f793c24b38bfd278e10b5786.tar.xz
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-attachment-dialog.c')
-rw-r--r--widgets/misc/e-attachment-dialog.c40
1 files changed, 8 insertions, 32 deletions
diff --git a/widgets/misc/e-attachment-dialog.c b/widgets/misc/e-attachment-dialog.c
index 45c2103e3d..c2a7149980 100644
--- a/widgets/misc/e-attachment-dialog.c
+++ b/widgets/misc/e-attachment-dialog.c
@@ -40,7 +40,10 @@ enum {
PROP_ATTACHMENT
};
-static gpointer parent_class;
+G_DEFINE_TYPE (
+ EAttachmentDialog,
+ e_attachment_dialog,
+ GTK_TYPE_DIALOG)
static void
attachment_dialog_update (EAttachmentDialog *dialog)
@@ -183,7 +186,7 @@ attachment_dialog_dispose (GObject *object)
}
/* Chain up to parent's dispose() method. */
- G_OBJECT_CLASS (parent_class)->dispose (object);
+ G_OBJECT_CLASS (e_attachment_dialog_parent_class)->dispose (object);
}
static void
@@ -193,7 +196,7 @@ attachment_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_attachment_dialog_parent_class)->map (widget);
/* XXX Override GtkDialog's broken style property defaults. */
action_area = gtk_dialog_get_action_area (GTK_DIALOG (widget));
@@ -255,13 +258,12 @@ attachment_dialog_response (GtkDialog *dialog,
}
static void
-attachment_dialog_class_init (EAttachmentDialogClass *class)
+e_attachment_dialog_class_init (EAttachmentDialogClass *class)
{
GObjectClass *object_class;
GtkWidgetClass *widget_class;
GtkDialogClass *dialog_class;
- parent_class = g_type_class_peek_parent (class);
g_type_class_add_private (class, sizeof (EAttachmentDialogPrivate));
object_class = G_OBJECT_CLASS (class);
@@ -288,7 +290,7 @@ attachment_dialog_class_init (EAttachmentDialogClass *class)
}
static void
-attachment_dialog_init (EAttachmentDialog *dialog)
+e_attachment_dialog_init (EAttachmentDialog *dialog)
{
GtkWidget *container;
GtkWidget *widget;
@@ -376,32 +378,6 @@ attachment_dialog_init (EAttachmentDialog *dialog)
gtk_widget_show (widget);
}
-GType
-e_attachment_dialog_get_type (void)
-{
- static GType type = 0;
-
- if (G_UNLIKELY (type == 0)) {
- static const GTypeInfo type_info = {
- sizeof (EAttachmentDialogClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) attachment_dialog_class_init,
- (GClassFinalizeFunc) NULL,
- NULL, /* class_init */
- sizeof (EAttachmentDialog),
- 0, /* n_preallocs */
- (GInstanceInitFunc) attachment_dialog_init,
- NULL /* value_table */
- };
-
- type = g_type_register_static (
- GTK_TYPE_DIALOG, "EAttachmentDialog", &type_info, 0);
- }
-
- return type;
-}
-
GtkWidget *
e_attachment_dialog_new (GtkWindow *parent,
EAttachment *attachment)