[epiphany] EphyTopicAction: Use g_object_class_install_properties.



commit fba43d4af2b8e56e3a36500655830bbd2c768c6c
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Sat Dec 12 14:58:42 2015 +0100

    EphyTopicAction: Use g_object_class_install_properties.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=759401

 src/bookmarks/ephy-topic-action.c |   39 +++++++++++++++++++------------------
 1 files changed, 20 insertions(+), 19 deletions(-)
---
diff --git a/src/bookmarks/ephy-topic-action.c b/src/bookmarks/ephy-topic-action.c
index 3519967..9a31f83 100644
--- a/src/bookmarks/ephy-topic-action.c
+++ b/src/bookmarks/ephy-topic-action.c
@@ -47,9 +47,12 @@ enum
 {
        PROP_0,
        PROP_TOPIC,
-       PROP_MANAGER
+       PROP_MANAGER,
+       LAST_PROP
 };
 
+static GParamSpec *obj_properties[LAST_PROP];
+
 G_DEFINE_TYPE (EphyTopicAction, ephy_topic_action, GTK_TYPE_ACTION)
 
 static void
@@ -274,7 +277,7 @@ ephy_topic_action_set_topic (EphyTopicAction *action,
        erase_popup (action);
        
        g_object_freeze_notify (object);
-       g_object_notify (object, "topic");
+       g_object_notify_by_pspec (object, obj_properties[PROP_TOPIC]);
        ephy_topic_action_updated (action);
        g_object_thaw_notify (object);
 }
@@ -336,23 +339,21 @@ ephy_topic_action_class_init (EphyTopicActionClass *class)
        object_class->set_property = ephy_topic_action_set_property;
        object_class->get_property = ephy_topic_action_get_property;
 
-       g_object_class_install_property (object_class,
-                                        PROP_TOPIC,
-                                        g_param_spec_pointer ("topic",
-                                                              "Topic",
-                                                              "Topic",
-                                                              G_PARAM_READWRITE | G_PARAM_STATIC_NAME | 
G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB |
-                                                              G_PARAM_CONSTRUCT_ONLY));
-
-       g_object_class_install_property (object_class,
-                                        PROP_MANAGER,
-                                        g_param_spec_object ("manager",
-                                                             "Manager",
-                                                             "UI Manager",
-                                                             GTK_TYPE_UI_MANAGER,
-                                                             G_PARAM_WRITABLE | G_PARAM_STATIC_NAME | 
G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB |
-                                                             G_PARAM_CONSTRUCT_ONLY));
-       
+       obj_properties[PROP_TOPIC] =
+               g_param_spec_pointer ("topic",
+                                     "Topic",
+                                     "Topic",
+                                     G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT_ONLY);
+
+       obj_properties[PROP_MANAGER] =
+               g_param_spec_object ("manager",
+                                    "Manager",
+                                    "UI Manager",
+                                    GTK_TYPE_UI_MANAGER,
+                                    G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT_ONLY);
+
+       g_object_class_install_properties (object_class, LAST_PROP, obj_properties);
+
        g_type_class_add_private (object_class, sizeof(EphyTopicActionPrivate));
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]