summaryrefslogtreecommitdiffstats
path: root/src/helper/action.cpp
diff options
context:
space:
mode:
authorAlex Valavanis <valavanisalex@gmail.com>2013-01-26 19:33:04 +0000
committerAlex Valavanis <valavanisalex@gmail.com>2013-01-26 19:33:04 +0000
commit1615436543169f305d1df4d830ed8f5ec5dc75ed (patch)
tree3357241d19485b7a0e0e190d66474cd58c8d9166 /src/helper/action.cpp
parentMore GObject boilerplate reduction (diff)
downloadinkscape-1615436543169f305d1df4d830ed8f5ec5dc75ed.tar.gz
inkscape-1615436543169f305d1df4d830ed8f5ec5dc75ed.zip
More GObject boilerplate reduction
(bzr r12065)
Diffstat (limited to 'src/helper/action.cpp')
-rw-r--r--src/helper/action.cpp41
1 files changed, 7 insertions, 34 deletions
diff --git a/src/helper/action.cpp b/src/helper/action.cpp
index 4fafa191e..0e9957ca3 100644
--- a/src/helper/action.cpp
+++ b/src/helper/action.cpp
@@ -19,34 +19,9 @@
#include "document.h"
#include "helper/action.h"
-static void sp_action_class_init (SPActionClass *klass);
-static void sp_action_init (SPAction *action);
static void sp_action_finalize (GObject *object);
-static GObjectClass *parent_class;
-
-/**
- * Register SPAction class and return its type.
- */
-GType
-sp_action_get_type (void)
-{
- static GType type = 0;
- if (!type) {
- GTypeInfo info = {
- sizeof(SPActionClass),
- NULL, NULL,
- (GClassInitFunc) sp_action_class_init,
- NULL, NULL,
- sizeof(SPAction),
- 0,
- (GInstanceInitFunc) sp_action_init,
- NULL
- };
- type = g_type_register_static(G_TYPE_OBJECT, "SPAction", &info, (GTypeFlags)0);
- }
- return type;
-}
+G_DEFINE_TYPE(SPAction, sp_action, G_TYPE_OBJECT);
/**
* SPAction vtable initialization.
@@ -54,8 +29,6 @@ sp_action_get_type (void)
static void
sp_action_class_init (SPActionClass *klass)
{
- parent_class = (GObjectClass*) g_type_class_ref(G_TYPE_OBJECT);
-
GObjectClass *object_class = (GObjectClass *) klass;
object_class->finalize = sp_action_finalize;
}
@@ -84,19 +57,19 @@ sp_action_init (SPAction *action)
static void
sp_action_finalize (GObject *object)
{
- SPAction *action = SP_ACTION(object);
+ SPAction *action = SP_ACTION(object);
- g_free (action->image);
- g_free (action->tip);
- g_free (action->name);
- g_free (action->id);
+ g_free (action->image);
+ g_free (action->tip);
+ g_free (action->name);
+ g_free (action->id);
action->signal_perform.~signal();
action->signal_set_sensitive.~signal();
action->signal_set_active.~signal();
action->signal_set_name.~signal();
- parent_class->finalize (object);
+ G_OBJECT_CLASS(sp_action_parent_class)->finalize (object);
}
/**