mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-13 15:56:23 +01:00
Filter out child schema entries when listing keys
This commit is contained in:
parent
025435329a
commit
d20969e07b
@ -164,7 +164,8 @@ key_exists (GSettings *settings,
|
||||
|
||||
keys = g_settings_list_keys (settings);
|
||||
for (i = 0; keys[i]; i++)
|
||||
if (g_strcmp0 (keys[i], name) == 0)
|
||||
if (!g_str_has_suffix (keys[i], "/") &&
|
||||
g_strcmp0 (keys[i], name) == 0)
|
||||
{
|
||||
ret = TRUE;
|
||||
break;
|
||||
@ -183,8 +184,11 @@ list_keys (GSettings *settings,
|
||||
|
||||
keys = g_settings_list_keys (settings);
|
||||
for (i = 0; keys[i]; i++)
|
||||
if (prefix == NULL || g_str_has_prefix (keys[i], prefix))
|
||||
g_print ("%s \n", keys[i]);
|
||||
{
|
||||
if (!g_str_has_suffix (keys[i], "/") &&
|
||||
(prefix == NULL || g_str_has_prefix (keys[i], prefix)))
|
||||
g_print ("%s \n", keys[i]);
|
||||
}
|
||||
g_free (keys);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user