Skip to content

GDBus: Add G_DBUS_METHOD_INVOCATION_HANDLED, _UNHANDLED

Simon McVittie requested to merge wip/smcv/invocation-handled into master
  • GDBus tests: Use G_SOURCE_REMOVE, G_SOURCE_CONTINUE

    The meaning of the boolean result of a GSource function is clearer if we use these aliases.

  • GDBus: Add G_DBUS_METHOD_INVOCATION_HANDLED, _UNHANDLED

    Like G_SOURCE_REMOVE and G_SOURCE_CONTINUE, these make it clearer what it means to return TRUE or FALSE.

    In particular, in GDBus methods that fail, the failure case still needs to return TRUE (unlike the typical GError pattern), leading to comments like this:

      g_dbus_method_invocation_return_error (invocation, ...);
      return TRUE;    /* handled */

    which can now be replaced by:

      g_dbus_method_invocation_return_error (invocation, ...);
      return G_DUS_METHOD_INVOCATION_HANDLED;

    G_DBUS_METHOD_INVOCATION_UNHANDLED is added for symmetry, but is very rarely (perhaps never?) useful in practice.

  • GDBus: Use G_DBUS_METHOD_INVOCATION_HANDLED in method implementations

Edited by Simon McVittie

Merge request reports