From 3ed3b5587b5a56ae37a2747e7c6ff800b8573010 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Thu, 21 Dec 2023 21:06:20 +0100 Subject: [PATCH] extensions-tool/list: Use new `enabled` property for filtering The new property is a better match for the `--enabled`/`--disabled` flags, not least because both are used for completions to the `enable` and `disable` commands. https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7004 Part-of: --- subprojects/extensions-tool/src/command-list.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/subprojects/extensions-tool/src/command-list.c b/subprojects/extensions-tool/src/command-list.c index 0ed1968ee..e5e4b8b95 100644 --- a/subprojects/extensions-tool/src/command-list.c +++ b/subprojects/extensions-tool/src/command-list.c @@ -71,13 +71,14 @@ list_extensions (ListFilterFlags filter, DisplayFormat format) while (g_variant_iter_loop (&iter, "{s@a{sv}}", &uuid, &value)) { g_autoptr (GVariantDict) info = NULL; - double type, state; + double type; gboolean has_prefs; gboolean has_update; + gboolean enabled; info = g_variant_dict_new (value); g_variant_dict_lookup (info, "type", "d", &type); - g_variant_dict_lookup (info, "state", "d", &state); + g_variant_dict_lookup (info, "enabled", "b", &enabled); g_variant_dict_lookup (info, "hasPrefs", "b", &has_prefs); g_variant_dict_lookup (info, "hasUpdate", "b", &has_update); @@ -87,10 +88,10 @@ list_extensions (ListFilterFlags filter, DisplayFormat format) if (type == TYPE_SYSTEM && (filter & LIST_FLAGS_SYSTEM) == 0) continue; - if (state == STATE_ACTIVE && (filter & LIST_FLAGS_ENABLED) == 0) + if (enabled && (filter & LIST_FLAGS_ENABLED) == 0) continue; - if (state != STATE_ACTIVE && (filter & LIST_FLAGS_DISABLED) == 0) + if (!enabled && (filter & LIST_FLAGS_DISABLED) == 0) continue; if (!has_prefs && (filter & LIST_FLAGS_NO_PREFS) == 0)