mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-02 07:23:41 +02:00
GVariant: improve bytestring support
- add G_VARIANT_TYPE_BYTESTRING, _BYTESTRING_ARRAY, _STRING_ARRAY - remove g_variant_{new,get}_byte_array functions - add g_variant_{new,get,dup}_bytestring{,_array} functions - remove undocumented support for deserialising arrays of objectpaths or signature strngs using g_variant_get_strv() - add and document new format strings '^ay', '^&ay', '^aay' and '^a&ay' - update GApplication to use the new API - update GSettings binding code to use the new API - add tests
This commit is contained in:
@@ -1006,7 +1006,7 @@ test_simple_binding (void)
|
||||
|
||||
g_object_set (obj, "string", "non-unicode:\315", NULL);
|
||||
value = g_settings_get_value (settings, "chararray");
|
||||
g_assert_cmpstr (g_variant_get_byte_array (value, NULL), ==, "non-unicode:\315");
|
||||
g_assert_cmpstr (g_variant_get_bytestring (value), ==, "non-unicode:\315");
|
||||
g_variant_unref (value);
|
||||
|
||||
g_settings_bind (settings, "double", obj, "double", G_SETTINGS_BIND_DEFAULT);
|
||||
|
@@ -41,11 +41,11 @@ on_app_activated (GApplication *application,
|
||||
while (g_variant_iter_next (&iter, "{&sv}", &key, &value))
|
||||
{
|
||||
const char *activate_cwd;
|
||||
gsize *len;
|
||||
|
||||
if (strcmp (key, "cwd") != 0)
|
||||
continue;
|
||||
|
||||
activate_cwd = g_variant_get_byte_array (value, &len);
|
||||
activate_cwd = g_variant_get_bytestring (value);
|
||||
g_assert_cmpstr (cwd, ==, activate_cwd);
|
||||
g_variant_unref (value);
|
||||
}
|
||||
|
Reference in New Issue
Block a user