[Xfce4-commits] r30128 - terminal/trunk/terminal

Nick Schermer nick at xfce.org
Tue Jun 30 19:28:40 CEST 2009


Author: nick
Date: 2009-06-30 17:28:40 +0000 (Tue, 30 Jun 2009)
New Revision: 30128

Modified:
   terminal/trunk/terminal/terminal-accel-map.c
Log:
Add a better way to lookup is a property exists.


Modified: terminal/trunk/terminal/terminal-accel-map.c
===================================================================
--- terminal/trunk/terminal/terminal-accel-map.c	2009-06-29 13:28:45 UTC (rev 30127)
+++ terminal/trunk/terminal/terminal-accel-map.c	2009-06-30 17:28:40 UTC (rev 30128)
@@ -141,9 +141,7 @@
                             GdkModifierType   accel_mods,
                             TerminalAccelMap *map)
 {
-  gchar        *property, *name;
-  GParamSpec **specs;
-  guint         nspecs, n;
+  gchar *property, *name;
 
   _terminal_return_if_fail (TERMINAL_IS_ACCEL_MAP (map));
   _terminal_return_if_fail (GTK_IS_ACCEL_MAP (object));
@@ -154,23 +152,14 @@
 
   /* create the property name */
   property = g_strconcat ("accel-", accel_path + 26, NULL);
-
-  /* check if the property exists in the preferences object */
-  specs = g_object_class_list_properties (G_OBJECT_GET_CLASS (map->preferences), &nspecs);
-  for (n = 0; n < nspecs; ++n)
+  if (g_object_class_find_property (G_OBJECT_GET_CLASS (map->preferences), property) != NULL)
     {
-      if (exo_str_is_equal (specs[n]->name, property))
-        {
-          /* store the new accelerator */
-          name = gtk_accelerator_name (accel_key, accel_mods);
-          g_object_set (G_OBJECT (map->preferences), property, name, NULL);
-          g_free (name);
-
-          break;
-        }
+      /* store the new accelerator */
+      name = gtk_accelerator_name (accel_key, accel_mods);
+      g_object_set (G_OBJECT (map->preferences), property, name, NULL);
+      g_free (name);
     }
   g_free (property);
-  g_free (specs);
 }
 
 




More information about the Xfce4-commits mailing list