aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXan Lopez <xan@src.gnome.org>2009-03-01 20:30:04 +0800
committerXan Lopez <xan@src.gnome.org>2009-03-01 20:30:04 +0800
commit97672832eb5830f252f69a015ddf1fab70cf12f7 (patch)
tree57954504b1717b00c329c89c212d1584d1843f55
parent44b5accafd19a1dfbc09b9b0318c371ab808b65b (diff)
downloadgsoc2013-epiphany-97672832eb5830f252f69a015ddf1fab70cf12f7.tar.gz
gsoc2013-epiphany-97672832eb5830f252f69a015ddf1fab70cf12f7.tar.zst
gsoc2013-epiphany-97672832eb5830f252f69a015ddf1fab70cf12f7.zip
ephy-file-chooser: use G_DEFINE_TYPE.
svn path=/trunk/; revision=8828
-rw-r--r--lib/ephy-file-chooser.c38
1 files changed, 4 insertions, 34 deletions
diff --git a/lib/ephy-file-chooser.c b/lib/ephy-file-chooser.c
index 216f3a2e3..75c075296 100644
--- a/lib/ephy-file-chooser.c
+++ b/lib/ephy-file-chooser.c
@@ -53,35 +53,7 @@ enum
#define PREVIEW_WIDTH 150
#define PREVIEW_HEIGHT 150
-static GObjectClass *parent_class = NULL;
-
-GType
-ephy_file_chooser_get_type (void)
-{
- static GType type = 0;
-
- if (G_UNLIKELY (type == 0))
- {
- const GTypeInfo our_info =
- {
- sizeof (EphyFileChooserClass),
- NULL,
- NULL,
- (GClassInitFunc) ephy_file_chooser_class_init,
- NULL,
- NULL,
- sizeof (EphyFileChooser),
- 0,
- (GInstanceInitFunc) ephy_file_chooser_init
- };
-
- type = g_type_register_static (GTK_TYPE_FILE_CHOOSER_DIALOG,
- "EphyFileChooser",
- &our_info, 0);
- }
-
- return type;
-}
+G_DEFINE_TYPE (EphyFileChooser, ephy_file_chooser, GTK_TYPE_FILE_CHOOSER_DIALOG)
static void
current_folder_changed_cb (GtkFileChooser *chooser, EphyFileChooser *dialog)
@@ -137,8 +109,8 @@ ephy_file_chooser_constructor (GType type,
GObject *object;
char *downloads_dir;
- object = parent_class->constructor (type, n_construct_properties,
- construct_params);
+ object = ephy_file_chooser_parent_class->constructor (type, n_construct_properties,
+ construct_params);
downloads_dir = ephy_file_get_downloads_dir ();
gtk_file_chooser_add_shortcut_folder
@@ -159,7 +131,7 @@ ephy_file_chooser_finalize (GObject *object)
LOG ("EphyFileChooser finalised");
- G_OBJECT_CLASS (parent_class)->finalize (object);
+ G_OBJECT_CLASS (ephy_file_chooser_parent_class)->finalize (object);
}
void
@@ -303,8 +275,6 @@ ephy_file_chooser_class_init (EphyFileChooserClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
- parent_class = g_type_class_peek_parent (klass);
-
object_class->constructor = ephy_file_chooser_constructor;
object_class->finalize = ephy_file_chooser_finalize;
object_class->get_property = ephy_file_chooser_get_property;