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: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3073>
This commit is contained in:
Florian Müllner 2023-12-21 21:06:20 +01:00 committed by Marge Bot
parent e8f125c57a
commit 3ed3b5587b

View File

@ -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)