Hi
On 8/30/26 7:48 PM, Marc-André Lureau wrote:
+static bool
+dbus_ui_info_apply_lookup(GDBusMethodInvocation *invocation,
+ GVariantDict *dict,
+ const gchar *key,
+ const gchar *fmt_str,
+ void *res)
+{
+ if (g_variant_dict_contains(dict, key) &&
+ !g_variant_dict_lookup(dict, key, fmt_str, res)) {
+ g_dbus_method_invocation_return_error(invocation,
+ DBUS_DISPLAY_ERROR,
+ DBUS_DISPLAY_ERROR_INVALID,
+ "%s must have D-Bus signature
%s",
+ key, fmt_str);
+ return false;
+ }
+ return true;
A bit surprising that the function returns true for unknown/invalid keys, but ok
The function will:
* return false for invalid key-value pairs (values have the wrong type
signature).
* return true otherwise.
So `dbus_ui_info_apply` will ignore extra keys, report errors for
invalid key-value pairs and accept a dictionary whose keys are a subset
of the schema keys. This behavior is expected.
lgtm, I can pick this patch unless you want to send a non-rfc version before
Okay. This patch is my final version and you can pick it.
Thanks for your guidance.