GSettingsSchema: fix g_settings_schema_has_key()

A settings schema that extends another schema should return TRUE for
all keys that are present in the extended schema. The list of keys
returned by list_keys() already includes these,
so it makes sense to include them in has_key().

Signed-off-by: Johannes Marte <johannes.marte@wolfvision.net>
This commit is contained in:
Johannes Marte 2024-04-23 14:30:12 +02:00 committed by Martin Domig
parent f06352f841
commit 58f9667def

View File

@ -1055,7 +1055,16 @@ gboolean
g_settings_schema_has_key (GSettingsSchema *schema,
const gchar *key)
{
return gvdb_table_has_value (schema->table, key);
GSettingsSchema *s;
if (gvdb_table_has_value (schema->table, key))
return TRUE;
for (s = schema; s; s = s->extends)
if (gvdb_table_has_value (s->table, key))
return TRUE;
return FALSE;
}
/**