]> Pileus Git - ~andy/gtk/commitdiff
cleaned up ::color-hash registration to not abuse class_n_properties and
authorTim Janik <timj@gtk.org>
Tue, 30 Jan 2007 11:10:22 +0000 (11:10 +0000)
committerTim Janik <timj@src.gnome.org>
Tue, 30 Jan 2007 11:10:22 +0000 (11:10 +0000)
Tue Jan 30 12:09:56 2007  Tim Janik  <timj@gtk.org>

        * gtk/gtksettings.c: cleaned up ::color-hash registration to not abuse
        class_n_properties and leave an uninitialized value array behind.

svn path=/trunk/; revision=17235

ChangeLog
gtk/gtksettings.c

index 1bd63a817303ed3473c1de2b7a19594a0203f8b4..22060e41219e046b8820b6082ca59b4589fe65e4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue Jan 30 12:09:56 2007  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtksettings.c: cleaned up ::color-hash registration to not abuse
+       class_n_properties and leave an uninitialized value array behind.
+
 2007-01-29  Michael Natterer  <mitch@imendio.com>
 
        * gtk/gtkmenuitem.c (gtk_menu_item_select)
index 2db01ccf05bec56f389979ce78c9b80af1b01729..191b98827f0ad28e4d54d2061649a08e0dce8351 100644 (file)
@@ -620,14 +620,14 @@ gtk_settings_class_init (GtkSettingsClass *class)
    *
    * Since: 2.10
    */
-  g_object_class_install_property (gobject_class,
-                                  PROP_COLOR_HASH,
-                                  g_param_spec_boxed ("color-hash",
-                                                      P_("Color Hash"),
-                                                      P_("A hash table representation of the color scheme."),
-                                                      G_TYPE_HASH_TABLE,
-                                                      GTK_PARAM_READABLE));
-  class_n_properties++;
+  result = settings_install_property_parser (class, 
+                                             g_param_spec_boxed ("color-hash",
+                                                                 P_("Color Hash"),
+                                                                 P_("A hash table representation of the color scheme."),
+                                                                 G_TYPE_HASH_TABLE,
+                                                                 GTK_PARAM_READABLE),
+                                             NULL);
+  g_assert (result == PROP_COLOR_HASH);
 
   result = settings_install_property_parser (class, 
                                              g_param_spec_string ("gtk-file-chooser-backend",
@@ -777,8 +777,10 @@ gtk_settings_get_property (GObject     *object,
   GType value_type = G_VALUE_TYPE (value);
   GType fundamental_type = G_TYPE_FUNDAMENTAL (value_type);
 
-  if (property_id == PROP_COLOR_HASH)
+  /* handle internal properties */
+  switch (property_id)
     {
+    case PROP_COLOR_HASH:
       g_value_set_boxed (value, get_color_hash (settings));
       return;
     }
@@ -1023,6 +1025,12 @@ settings_install_property_parser (GtkSettingsClass   *class,
     case G_TYPE_DOUBLE:
     case G_TYPE_STRING:
       break;
+    case G_TYPE_BOXED:
+      if (strcmp (g_param_spec_get_name (pspec), "color-hash") == 0)
+        {
+          break;
+        }
+      /* fall through */
     default:
       if (!parser)
         {