diff options
Diffstat (limited to 'libnautilus-extension')
-rw-r--r-- | libnautilus-extension/nautilus-column.c | 34 | ||||
-rw-r--r-- | libnautilus-extension/nautilus-menu.c | 30 |
2 files changed, 6 insertions, 58 deletions
diff --git a/libnautilus-extension/nautilus-column.c b/libnautilus-extension/nautilus-column.c index efba54527..646e64ef4 100644 --- a/libnautilus-extension/nautilus-column.c +++ b/libnautilus-extension/nautilus-column.c @@ -45,7 +45,7 @@ struct _NautilusColumnDetails { float xalign; }; -static GObjectClass *parent_class = NULL; +G_DEFINE_TYPE (NautilusColumn, nautilus_column, G_TYPE_OBJECT); /** * nautilus_column_new: @@ -170,11 +170,11 @@ nautilus_column_finalize (GObject *object) g_free (column->details); - G_OBJECT_CLASS (parent_class)->finalize (object); + G_OBJECT_CLASS (nautilus_column_parent_class)->finalize (object); } static void -nautilus_column_instance_init (NautilusColumn *column) +nautilus_column_init (NautilusColumn *column) { column->details = g_new0 (NautilusColumnDetails, 1); column->details->xalign = 0.0; @@ -183,8 +183,6 @@ nautilus_column_instance_init (NautilusColumn *column) static void nautilus_column_class_init (NautilusColumnClass *class) { - parent_class = g_type_class_peek_parent (class); - G_OBJECT_CLASS (class)->finalize = nautilus_column_finalize; G_OBJECT_CLASS (class)->get_property = nautilus_column_get_property; G_OBJECT_CLASS (class)->set_property = nautilus_column_set_property; @@ -236,29 +234,3 @@ nautilus_column_class_init (NautilusColumnClass *class) G_PARAM_READWRITE)); } -GType -nautilus_column_get_type (void) -{ - static GType type = 0; - - if (!type) { - const GTypeInfo info = { - sizeof (NautilusColumnClass), - NULL, - NULL, - (GClassInitFunc)nautilus_column_class_init, - NULL, - NULL, - sizeof (NautilusColumn), - 0, - (GInstanceInitFunc)nautilus_column_instance_init - }; - - type = g_type_register_static - (G_TYPE_OBJECT, - "NautilusColumn", - &info, 0); - } - - return type; -} diff --git a/libnautilus-extension/nautilus-menu.c b/libnautilus-extension/nautilus-menu.c index 36a19cb31..dc2dac71f 100644 --- a/libnautilus-extension/nautilus-menu.c +++ b/libnautilus-extension/nautilus-menu.c @@ -28,6 +28,7 @@ #include <glib.h> #define NAUTILUS_MENU_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NAUTILUS_TYPE_MENU, NautilusMenuPrivate)) +G_DEFINE_TYPE (NautilusMenu, nautilus_menu, G_TYPE_OBJECT); struct _NautilusMenuPrivate { GList *item_list; @@ -70,13 +71,12 @@ static void nautilus_menu_finalize (GObject *object) { NautilusMenu *this = NAUTILUS_MENU (object); - GObjectClass *parent_class = g_type_class_peek_parent (NAUTILUS_MENU_GET_CLASS (object)); - + if (this->private->item_list) { g_list_free (this->private->item_list); } - parent_class->finalize (object); + G_OBJECT_CLASS (nautilus_menu_parent_class)->finalize (object); } static void @@ -97,30 +97,6 @@ nautilus_menu_class_init (NautilusMenuClass *klass) object_class->finalize = nautilus_menu_finalize; } -GType -nautilus_menu_get_type (void) -{ - static GType type = 0; - - if(type == 0) { - const GTypeInfo info = { - sizeof (NautilusMenuClass), - (GBaseInitFunc) NULL, - (GBaseFinalizeFunc) NULL, - (GClassInitFunc) nautilus_menu_class_init, - (GClassFinalizeFunc) NULL, - NULL, - sizeof (NautilusMenu), - 0, - (GInstanceInitFunc) nautilus_menu_init, - }; - - type = g_type_register_static (G_TYPE_OBJECT, "NautilusMenu", &info, 0); - } - - return type; -} - /* public constructors */ NautilusMenu * |