What GLib type should a{ss} map to when using GSettings?

352 Views Asked by At

I have a gsettings schema with a key of type a{ss}. I would like to bind said key to a property on an object. I have successfully used g_settings_bind and g_settings_bind_with_mapping with other keys but I don't know what type to map this key to. The GVariant is an array of dictionaries with key string and value string, but what accual glib type is that?

1

There are 1 best solutions below

2
On BEST ANSWER

You need to use g_settings_bind_with_mapping(), since a{ss} is not supported by g_settings_bind(). a{ss} is a dictionary mapping strings to strings, and I would probably represent it in GLib as a GHashTable mapping strings to strings.