diff options
author | Juan Pablo Ugarte <juanpablougarte@gmail.com> | 2011-03-31 20:52:11 -0300 |
---|---|---|
committer | Juan Pablo Ugarte <juanpablougarte@gmail.com> | 2011-03-31 20:52:11 -0300 |
commit | 6846485c0d39f6c7791a78179b0f893c8a3cdd2a (patch) | |
tree | 44262da5cdb5434cacb24f18ec4f6d9ba8cefcf1 /gladeui/glade-widget-action.c | |
parent | fd2be3bd491010fc9c05fd3fdf07fc03b0c7eeb8 (diff) | |
download | glade-6846485c0d39f6c7791a78179b0f893c8a3cdd2a.tar.gz |
* gladeui/glade-base-editor.c,
gladeui/glade-cell-renderer-icon.c,
gladeui/glade-clipboard.c,
gladeui/glade-editor.c,
gladeui/glade-inspector.c,
gladeui/glade-palette.c,
gladeui/glade-project.c,
gladeui/glade-property.c,
gladeui/glade-signal.c,
gladeui/glade-widget-action.c,
gladeui/glade-widget.c:
Replaced g_object_notify() with g_object_notify_by_spec()
Diffstat (limited to 'gladeui/glade-widget-action.c')
-rw-r--r-- | gladeui/glade-widget-action.c | 55 |
1 files changed, 28 insertions, 27 deletions
diff --git a/gladeui/glade-widget-action.c b/gladeui/glade-widget-action.c index 5ed1a0ea..9961b537 100644 --- a/gladeui/glade-widget-action.c +++ b/gladeui/glade-widget-action.c @@ -39,7 +39,8 @@ enum PROP_CLASS, PROP_SENSITIVE, - PROP_VISIBLE + PROP_VISIBLE, + N_PROPERTIES }; struct _GladeWidgetActionPrivate @@ -50,6 +51,8 @@ struct _GladeWidgetActionPrivate guint visible : 1; /* If this action is visible or not */ }; +static GParamSpec *properties[N_PROPERTIES]; + G_DEFINE_TYPE (GladeWidgetAction, glade_widget_action, G_TYPE_OBJECT); static void @@ -176,30 +179,28 @@ glade_widget_action_class_init (GladeWidgetActionClass * klass) object_class->set_property = glade_widget_action_set_property; object_class->get_property = glade_widget_action_get_property; - g_object_class_install_property (object_class, - PROP_CLASS, - g_param_spec_pointer ("class", - _("class"), - _ - ("GladeWidgetActionClass structure pointer"), - G_PARAM_CONSTRUCT_ONLY - | G_PARAM_WRITABLE)); - - g_object_class_install_property (object_class, - PROP_SENSITIVE, - g_param_spec_boolean ("sensitive", - _("Sensitive"), - _("Whether this action is sensitive"), - TRUE, - G_PARAM_READWRITE)); - - g_object_class_install_property (object_class, - PROP_VISIBLE, - g_param_spec_boolean ("visible", - _("Visible"), - _("Whether this action is visible"), - TRUE, - G_PARAM_READWRITE)); + properties[PROP_CLASS] = + g_param_spec_pointer ("class", + _("class"), + _("GladeWidgetActionClass structure pointer"), + G_PARAM_CONSTRUCT_ONLY | G_PARAM_WRITABLE); + + properties[PROP_SENSITIVE] = + g_param_spec_boolean ("sensitive", + _("Sensitive"), + _("Whether this action is sensitive"), + TRUE, + G_PARAM_READWRITE); + + properties[PROP_VISIBLE] = + g_param_spec_boolean ("visible", + _("Visible"), + _("Whether this action is visible"), + TRUE, + G_PARAM_READWRITE); + + /* Install all properties */ + g_object_class_install_properties (object_class, N_PROPERTIES, properties); g_type_class_add_private (klass, sizeof (GladeWidgetActionPrivate)); } @@ -219,7 +220,7 @@ glade_widget_action_set_sensitive (GladeWidgetAction * action, g_return_if_fail (GLADE_IS_WIDGET_ACTION (action)); action->priv->sensitive = sensitive; - g_object_notify (G_OBJECT (action), "sensitive"); + g_object_notify_by_pspec (G_OBJECT (action), properties[PROP_SENSITIVE]); } gboolean @@ -237,7 +238,7 @@ glade_widget_action_set_visible (GladeWidgetAction *action, g_return_if_fail (GLADE_IS_WIDGET_ACTION (action)); action->priv->visible = visible; - g_object_notify (G_OBJECT (action), "visible"); + g_object_notify_by_pspec (G_OBJECT (action), properties[PROP_VISIBLE]); } gboolean |