Implement a list of properties to not test generically
This commit is contained in:
parent
908765d60d
commit
2379e7ac75
1 changed files with 27 additions and 0 deletions
|
@ -17,6 +17,29 @@
|
||||||
#include "midori-bookmarks.h"
|
#include "midori-bookmarks.h"
|
||||||
#include "sokoke.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 \
|
#define pspec_is_writable(pspec) (pspec->flags & G_PARAM_WRITABLE \
|
||||||
&& !(pspec->flags & (G_PARAM_CONSTRUCT | G_PARAM_CONSTRUCT_ONLY)))
|
&& !(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))
|
if (pspec->owner_type != G_OBJECT_TYPE (object))
|
||||||
continue;
|
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);
|
g_object_get (object, property, &value, NULL);
|
||||||
if (type == G_TYPE_PARAM_BOOLEAN)
|
if (type == G_TYPE_PARAM_BOOLEAN)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue