[libpeas] Cleanup PeasActivatable's init



commit 85560b25673ef003e709761142f3c1d9db3e649a
Author: Garrett Regier <garrettregier gmail com>
Date:   Sun Mar 29 20:26:39 2015 -0700

    Cleanup PeasActivatable's init
    
    The function should be a static function. Also, it
    will only ever be called once so there is no need
    for doing the check/set initialized dance.

 libpeas/peas-activatable.c |   39 ++++++++++++++++-----------------------
 1 files changed, 16 insertions(+), 23 deletions(-)
---
diff --git a/libpeas/peas-activatable.c b/libpeas/peas-activatable.c
index 9006195..35f25e5 100644
--- a/libpeas/peas-activatable.c
+++ b/libpeas/peas-activatable.c
@@ -47,31 +47,24 @@
 
 G_DEFINE_INTERFACE(PeasActivatable, peas_activatable, G_TYPE_OBJECT)
 
-void
+static void
 peas_activatable_default_init (PeasActivatableInterface *iface)
 {
-  static gboolean initialized = FALSE;
-
-  if (!initialized)
-    {
-      /**
-       * PeasActivatable:object:
-       *
-       * The object property contains the targetted object for this
-       * #PeasActivatable instance, for example a toplevel window in a typical
-       * windowed application. It is set at construction time and won't change.
-       */
-      g_object_interface_install_property (iface,
-                                           g_param_spec_object ("object",
-                                                                "Object",
-                                                                "Object",
-                                                                G_TYPE_OBJECT,
-                                                                G_PARAM_READWRITE |
-                                                                G_PARAM_CONSTRUCT_ONLY |
-                                                                G_PARAM_STATIC_STRINGS));
-
-      initialized = TRUE;
-    }
+  /**
+   * PeasActivatable:object:
+   *
+   * The object property contains the targetted object for this
+   * #PeasActivatable instance, for example a toplevel window in a typical
+   * windowed application. It is set at construction time and won't change.
+   */
+  g_object_interface_install_property (iface,
+                                       g_param_spec_object ("object",
+                                                            "Object",
+                                                            "Object",
+                                                            G_TYPE_OBJECT,
+                                                            G_PARAM_READWRITE |
+                                                            G_PARAM_CONSTRUCT_ONLY |
+                                                            G_PARAM_STATIC_STRINGS));
 }
 
 /**


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