mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-12 15:36:17 +01:00
Add g_dbus_method_invocation_take_error() convenience method
Similar in spirit to g_simple_async_result_take_error(). Signed-off-by: David Zeuthen <davidz@redhat.com>
This commit is contained in:
parent
d39731724a
commit
5a811135f7
@ -2518,6 +2518,7 @@ g_dbus_method_invocation_return_error_valist
|
||||
g_dbus_method_invocation_return_error_literal
|
||||
g_dbus_method_invocation_return_gerror
|
||||
g_dbus_method_invocation_return_dbus_error
|
||||
g_dbus_method_invocation_take_error
|
||||
<SUBSECTION Standard>
|
||||
G_DBUS_METHOD_INVOCATION
|
||||
G_IS_DBUS_METHOD_INVOCATION
|
||||
|
@ -555,6 +555,28 @@ g_dbus_method_invocation_return_gerror (GDBusMethodInvocation *invocation,
|
||||
g_free (dbus_error_name);
|
||||
}
|
||||
|
||||
/**
|
||||
* g_dbus_method_invocation_take_error: (skip)
|
||||
* @invocation: (transfer full): A #GDBusMethodInvocation.
|
||||
* @error: (transfer full): A #GError.
|
||||
*
|
||||
* Like g_dbus_method_invocation_return_gerror() but takes ownership
|
||||
* of @error so the caller does not need to free it.
|
||||
*
|
||||
* This method will free @invocation, you cannot use it afterwards.
|
||||
*
|
||||
* Since: 2.30
|
||||
*/
|
||||
void
|
||||
g_dbus_method_invocation_take_error (GDBusMethodInvocation *invocation,
|
||||
GError *error)
|
||||
{
|
||||
g_return_if_fail (G_IS_DBUS_METHOD_INVOCATION (invocation));
|
||||
g_return_if_fail (error != NULL);
|
||||
g_dbus_method_invocation_return_gerror (invocation, error);
|
||||
g_error_free (error);
|
||||
}
|
||||
|
||||
/**
|
||||
* g_dbus_method_invocation_return_dbus_error:
|
||||
* @invocation: (transfer full): A #GDBusMethodInvocation.
|
||||
|
@ -64,6 +64,8 @@ void g_dbus_method_invocation_return_error_literal (GDBusMetho
|
||||
const gchar *message);
|
||||
void g_dbus_method_invocation_return_gerror (GDBusMethodInvocation *invocation,
|
||||
const GError *error);
|
||||
void g_dbus_method_invocation_take_error (GDBusMethodInvocation *invocation,
|
||||
GError *error);
|
||||
void g_dbus_method_invocation_return_dbus_error (GDBusMethodInvocation *invocation,
|
||||
const gchar *error_name,
|
||||
const gchar *error_message);
|
||||
|
@ -1824,6 +1824,7 @@ g_dbus_method_invocation_return_error
|
||||
g_dbus_method_invocation_return_error_literal
|
||||
g_dbus_method_invocation_return_error_valist
|
||||
g_dbus_method_invocation_return_gerror
|
||||
g_dbus_method_invocation_take_error
|
||||
g_dbus_method_invocation_return_value
|
||||
#endif
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user