From 018581adb55828961c5e03c6c35dcf3eb9e5cff4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Tyrychtr?= Date: Wed, 14 Aug 2024 16:14:45 +0000 Subject: [PATCH] gsettings-tool: Always use the global_schema_source to lookup schemas in list-recursively When listing schemas from a specified directory, explicitly create the GSettings object from the schema, don't allow g_settings_new to do the usual lookup. That lookup fails if no other schemas are installed in the default directories. Fixes #3429. --- gio/gsettings-tool.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gio/gsettings-tool.c b/gio/gsettings-tool.c index 8f3e01ff3..21d9b92ac 100644 --- a/gio/gsettings-tool.c +++ b/gio/gsettings-tool.c @@ -324,10 +324,15 @@ gsettings_list_recursively (void) for (i = 0; schemas[i]; i++) { GSettings *settings; + GSettingsSchema *schema; - settings = g_settings_new (schemas[i]); + schema = g_settings_schema_source_lookup (global_schema_source, schemas[i], FALSE); + if (!schema) + continue; + settings = g_settings_new_full (schema, NULL, NULL); list_recursively (settings); g_object_unref (settings); + g_settings_schema_unref (schema); } g_strfreev (schemas);