[tepl] ApplicationWindow: do not store properties GParamSpec's



commit 28e3c3a55bccf6be33e18d198654f6e403a0d62a
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Thu Jul 20 19:15:58 2017 +0200

    ApplicationWindow: do not store properties GParamSpec's
    
    With g_object_class_override_property(), we don't have the GParamSpec,
    so we cannot call g_object_notify_by_pspec(). For code consistency, it's
    better to notify all the properties in the same way, because otherwise
    it's dangerous to have some properties that can be notified_by_pspec and
    others not (in the same enum).

 tepl/tepl-application-window.c |   22 +++++++++-------------
 1 files changed, 9 insertions(+), 13 deletions(-)
---
diff --git a/tepl/tepl-application-window.c b/tepl/tepl-application-window.c
index 36e9d44..7604061 100644
--- a/tepl/tepl-application-window.c
+++ b/tepl/tepl-application-window.c
@@ -66,13 +66,10 @@ enum
 {
        PROP_0,
        PROP_APPLICATION_WINDOW,
-       N_PROPERTIES
 };
 
 #define TEPL_APPLICATION_WINDOW_KEY "tepl-application-window-key"
 
-static GParamSpec *properties[N_PROPERTIES];
-
 static void tepl_tab_group_interface_init (gpointer g_iface,
                                           gpointer iface_data);
 
@@ -165,16 +162,15 @@ tepl_application_window_class_init (TeplApplicationWindowClass *klass)
         *
         * Since: 2.0
         */
-       properties[PROP_APPLICATION_WINDOW] =
-               g_param_spec_object ("application-window",
-                                    "GtkApplicationWindow",
-                                    "",
-                                    GTK_TYPE_APPLICATION_WINDOW,
-                                    G_PARAM_READWRITE |
-                                    G_PARAM_CONSTRUCT_ONLY |
-                                    G_PARAM_STATIC_STRINGS);
-
-       g_object_class_install_properties (object_class, N_PROPERTIES, properties);
+       g_object_class_install_property (object_class,
+                                        PROP_APPLICATION_WINDOW,
+                                        g_param_spec_object ("application-window",
+                                                             "GtkApplicationWindow",
+                                                             "",
+                                                             GTK_TYPE_APPLICATION_WINDOW,
+                                                             G_PARAM_READWRITE |
+                                                             G_PARAM_CONSTRUCT_ONLY |
+                                                             G_PARAM_STATIC_STRINGS));
 }
 
 static GList *


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