[gnome-builder] gnome-code-assistance: Fix options dict building
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] gnome-code-assistance: Fix options dict building
- Date: Thu, 27 Jan 2022 21:15:48 +0000 (UTC)
commit a35cfcade669b02833f605e27182981865042b78
Author: Phaedrus Leeds <mwleeds protonmail com>
Date: Thu Jan 27 13:07:51 2022 -0800
gnome-code-assistance: Fix options dict building
I copied the line "g_variant_new ("a{sv}", 0);" into libportal and it
led to an error message:
Bail out!
GLib:ERROR:../glib/gvarianttypeinfo.c:164:g_variant_type_info_check:
assertion failed: (info->alignment == 0 || info->alignment == 1 ||
info->alignment == 3 || info->alignment == 7)
So I assume it's wrong here too. I also don't know why
G_VARIANT_TYPE_ARRAY is being used, seems like it should be
G_VARIANT_TYPE_VARDICT.
.../gnome-code-assistance/ide-gca-diagnostic-provider.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
---
diff --git a/src/plugins/gnome-code-assistance/ide-gca-diagnostic-provider.c
b/src/plugins/gnome-code-assistance/ide-gca-diagnostic-provider.c
index 0b749561f..93c84b63a 100644
--- a/src/plugins/gnome-code-assistance/ide-gca-diagnostic-provider.c
+++ b/src/plugins/gnome-code-assistance/ide-gca-diagnostic-provider.c
@@ -313,19 +313,17 @@ parse_cb (GObject *object,
static GVariant *
get_parse_options (void)
{
+ GVariantBuilder builder;
+
+ g_variant_builder_init (&builder, G_VARIANT_TYPE_VARDICT);
+
if (G_UNLIKELY (gca_settings == NULL))
gca_settings = g_settings_new ("org.gnome.builder.gnome-code-assistance");
if (g_settings_get_boolean (gca_settings, "enable-pylint"))
- {
- GVariantBuilder builder;
-
- g_variant_builder_init (&builder, G_VARIANT_TYPE_ARRAY);
- g_variant_builder_add (&builder, "{sv}", "pylint", g_variant_new_boolean (TRUE));
- return g_variant_builder_end (&builder);
- }
+ g_variant_builder_add (&builder, "{sv}", "pylint", g_variant_new_boolean (TRUE));
- return g_variant_new ("a{sv}", 0);
+ return g_variant_builder_end (&builder);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]