mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-12 20:00:09 +00:00
a11y: Correct return type of D-Bus call
org.freedesktop.DBus.Properties.Get() returns "(v)" which then must be unpacked into an uint32 ("u") variant.
This commit is contained in:
parent
c2dc459167
commit
24841a8d5b
@ -597,6 +597,7 @@ static bool
|
|||||||
check_flatpak_portal_version (GDBusConnection *connection,
|
check_flatpak_portal_version (GDBusConnection *connection,
|
||||||
unsigned int minimum_version)
|
unsigned int minimum_version)
|
||||||
{
|
{
|
||||||
|
GVariant *child;
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
|
||||||
GVariant *res =
|
GVariant *res =
|
||||||
@ -606,7 +607,7 @@ check_flatpak_portal_version (GDBusConnection *connection,
|
|||||||
"org.freedesktop.DBus.Properties",
|
"org.freedesktop.DBus.Properties",
|
||||||
"Get",
|
"Get",
|
||||||
g_variant_new ("(ss)", "org.freedesktop.portal.Flatpak", "version"),
|
g_variant_new ("(ss)", "org.freedesktop.portal.Flatpak", "version"),
|
||||||
G_VARIANT_TYPE ("(u)"),
|
G_VARIANT_TYPE ("(v)"),
|
||||||
G_DBUS_CALL_FLAGS_NONE,
|
G_DBUS_CALL_FLAGS_NONE,
|
||||||
-1,
|
-1,
|
||||||
NULL,
|
NULL,
|
||||||
@ -620,10 +621,12 @@ check_flatpak_portal_version (GDBusConnection *connection,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
guint32 version = 0;
|
g_variant_get (res, "(v)", &child);
|
||||||
g_variant_get (res, "(u)", &version);
|
|
||||||
g_variant_unref (res);
|
g_variant_unref (res);
|
||||||
|
|
||||||
|
guint32 version = g_variant_get_uint32 (child);
|
||||||
|
g_variant_unref (child);
|
||||||
|
|
||||||
GTK_DEBUG (A11Y, "Flatpak portal version: %u (required: %u)", version, minimum_version);
|
GTK_DEBUG (A11Y, "Flatpak portal version: %u (required: %u)", version, minimum_version);
|
||||||
|
|
||||||
return version >= minimum_version;
|
return version >= minimum_version;
|
||||||
|
Loading…
Reference in New Issue
Block a user