[epiphany] EphyZoomAction: Use g_object_class_install_properties.
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany] EphyZoomAction: Use g_object_class_install_properties.
- Date: Wed, 16 Dec 2015 13:09:14 +0000 (UTC)
commit e71369ca72b9715285ecdc8fa7bbc6c9a7f0675f
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date: Sat Dec 12 18:08:58 2015 +0100
EphyZoomAction: Use g_object_class_install_properties.
https://bugzilla.gnome.org/show_bug.cgi?id=759401
lib/widgets/ephy-zoom-action.c | 21 ++++++++++++---------
1 files changed, 12 insertions(+), 9 deletions(-)
---
diff --git a/lib/widgets/ephy-zoom-action.c b/lib/widgets/ephy-zoom-action.c
index 70f22d9..21db97b 100644
--- a/lib/widgets/ephy-zoom-action.c
+++ b/lib/widgets/ephy-zoom-action.c
@@ -40,9 +40,11 @@ struct _EphyZoomActionPrivate
enum
{
PROP_0,
- PROP_ZOOM
+ PROP_ZOOM,
+ LAST_PROP
};
+static GParamSpec *obj_properties[LAST_PROP];
static void ephy_zoom_action_init (EphyZoomAction *action);
static void ephy_zoom_action_class_init (EphyZoomActionClass *class);
@@ -164,13 +166,14 @@ ephy_zoom_action_class_init (EphyZoomActionClass *class)
*
* The current value of #EphyZoomAction, as a float.
*/
- g_object_class_install_property (object_class,
- PROP_ZOOM,
- g_param_spec_float ("zoom", NULL, NULL,
- ZOOM_MINIMAL,
- ZOOM_MAXIMAL,
- 1.0,
- G_PARAM_READWRITE | G_PARAM_STATIC_NAME |
G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
+ obj_properties[PROP_ZOOM] =
+ g_param_spec_float ("zoom", NULL, NULL,
+ ZOOM_MINIMAL,
+ ZOOM_MAXIMAL,
+ 1.0,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
+
+ g_object_class_install_properties (object_class, LAST_PROP, obj_properties);
/**
* EphyZoomAction::zoom-to-level:
@@ -216,7 +219,7 @@ ephy_zoom_action_set_zoom_level (EphyZoomAction *action, float zoom)
if (zoom < ZOOM_MINIMAL || zoom > ZOOM_MAXIMAL) return;
action->priv->zoom = zoom;
- g_object_notify (G_OBJECT (action), "zoom");
+ g_object_notify_by_pspec (G_OBJECT (action), obj_properties[PROP_ZOOM]);
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]