]> spindle.queued.net Git - midori/commitdiff
Implement a list of properties to not test generically
authorChristian Dywan <christian@twotoasts.de>
Sun, 12 Jul 2009 11:54:03 +0000 (13:54 +0200)
committerChristian Dywan <christian@twotoasts.de>
Sun, 12 Jul 2009 11:54:03 +0000 (13:54 +0200)
tests/properties.c

index deb6266e5c03d0d819b68871fbf85a925b5c7167..4df58b95e43c0ca6ed5300b7fd1955c238357365 100644 (file)
 #include "midori-bookmarks.h"
 #include "sokoke.h"
 
+typedef struct
+{
+    const gchar* type;
+    const gchar* property;
+} ObjectProperty;
+
+static ObjectProperty properties_object_skip[] =
+{
+    { "MidoriWebSettings", "ident-string" },
+};
+
+static gboolean
+properties_should_skip (const gchar* type,
+                        const gchar* property)
+{
+    guint i;
+    for (i = 0; i < G_N_ELEMENTS (properties_object_skip); i++)
+        if (g_str_equal (properties_object_skip[i].type, type))
+            if (g_str_equal (properties_object_skip[i].property, property))
+                return TRUE;
+    return FALSE;
+}
+
 #define pspec_is_writable(pspec) (pspec->flags & G_PARAM_WRITABLE \
     && !(pspec->flags & (G_PARAM_CONSTRUCT | G_PARAM_CONSTRUCT_ONLY)))
 
@@ -40,6 +63,10 @@ properties_object_get_set (GObject* object)
         if (pspec->owner_type != G_OBJECT_TYPE (object))
             continue;
 
+        /* Skip properties that cannot be tested generically */
+        if (properties_should_skip (G_OBJECT_TYPE_NAME (object), property))
+            continue;
+
         g_object_get (object, property, &value, NULL);
         if (type == G_TYPE_PARAM_BOOLEAN)
         {