I’m trying to save print and page settings using gsettings.
( from gtk_print_settings_to_gvariant() )
In my program.gschema.xml file I have …
<key name="print-settings" type="a(sv)">
<default></default>
<summary>GTK print settings</summary>
<description>The print settings that were last used</description>
</key>
<key name="page-settings" type="a(sv)">
<default></default>
<summary>GTK page settings</summary>
<description>The page settings that were last used</description>
</key>
but when I compile this I get the error:
😼 glib-compile-schemas --dry-run .
./HPGLplotter.gschema.xml:8:1 Failed to parse <default> value of type “a(sv)”: 0:expected value. This entire file has been ignored.
😼
What do you use as the default value for an array like this?
I still have a problem. I’m getting an error when I use g_settings_set_value().
I get this error on either print or page settings
Print Settings is of type a{sv}
Print Setup is of type a{sv}
Bail out! GLib:ERROR:../glib/gvarianttypeinfo.c:190:g_variant_type_info_check: assertion failed: (0 <= index && index < 24)
Yes, floating references are something you have to be aware of when working with GVariants. They can make using them in C code a lot simpler, but can be a footgun if you’re not aware of them, unfortunately.