[epiphany] EphyNotebook: Use g_object_class_install_properties.
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany] EphyNotebook: Use g_object_class_install_properties.
- Date: Wed, 16 Dec 2015 13:08:03 +0000 (UTC)
commit 468d6b2fb900e136e625804c3b909138e42d88fb
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date: Fri Dec 11 01:26:44 2015 +0100
EphyNotebook: Use g_object_class_install_properties.
https://bugzilla.gnome.org/show_bug.cgi?id=759401
src/ephy-notebook.c | 20 +++++++++++++-------
1 files changed, 13 insertions(+), 7 deletions(-)
---
diff --git a/src/ephy-notebook.c b/src/ephy-notebook.c
index a6a7349..352d913 100644
--- a/src/ephy-notebook.c
+++ b/src/ephy-notebook.c
@@ -73,9 +73,12 @@ static const GtkTargetEntry url_drag_types [] =
enum
{
PROP_0,
- PROP_TABS_ALLOWED
+ PROP_TABS_ALLOWED,
+ LAST_PROP
};
+static GParamSpec *obj_properties[LAST_PROP];
+
enum
{
TAB_CLOSE_REQUEST,
@@ -147,11 +150,14 @@ ephy_notebook_class_init (EphyNotebookClass *klass)
1,
GTK_TYPE_WIDGET /* Can't use an interface type here */);
- g_object_class_install_property (object_class,
- PROP_TABS_ALLOWED,
- g_param_spec_boolean ("tabs-allowed", NULL, NULL,
- TRUE,
- G_PARAM_READWRITE | G_PARAM_STATIC_NAME |
G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
+ obj_properties[PROP_TABS_ALLOWED] =
+ g_param_spec_boolean ("tabs-allowed",
+ NULL,
+ NULL,
+ TRUE,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
+
+ g_object_class_install_properties (object_class, LAST_PROP, obj_properties);
g_type_class_add_private (object_class, sizeof (EphyNotebookPrivate));
}
@@ -670,7 +676,7 @@ ephy_notebook_set_tabs_allowed (EphyNotebook *nb,
update_tabs_visibility (nb, FALSE);
- g_object_notify (G_OBJECT (nb), "tabs-allowed");
+ g_object_notify_by_pspec (G_OBJECT (nb), obj_properties[PROP_TABS_ALLOWED]);
}
static int
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]