mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-02 17:26:17 +01:00
GDBus: Use G_DBUS_METHOD_INVOCATION_HANDLED in method implementations
Signed-off-by: Simon McVittie <smcv@collabora.com>
This commit is contained in:
parent
d65c8c30a9
commit
38a2aed5f0
@ -53,7 +53,7 @@ on_animal_poke (ExampleAnimal *animal,
|
|||||||
g_assert_not_reached ();
|
g_assert_not_reached ();
|
||||||
|
|
||||||
out:
|
out:
|
||||||
return TRUE; /* to indicate that the method was handled */
|
return G_DBUS_METHOD_INVOCATION_HANDLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1719,7 +1719,7 @@ codegen_on_animal_poke (ExampleAnimal *animal,
|
|||||||
g_assert_not_reached ();
|
g_assert_not_reached ();
|
||||||
|
|
||||||
out:
|
out:
|
||||||
return TRUE; /* to indicate that the method was handled */
|
return G_DBUS_METHOD_INVOCATION_HANDLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Runs in thread we created GDBusServer in (since we didn't pass G_DBUS_SERVER_FLAGS_RUN_IN_THREAD) */
|
/* Runs in thread we created GDBusServer in (since we didn't pass G_DBUS_SERVER_FLAGS_RUN_IN_THREAD) */
|
||||||
|
@ -33,6 +33,11 @@
|
|||||||
|
|
||||||
#include "gdbus-test-codegen-generated-interface-info.h"
|
#include "gdbus-test-codegen-generated-interface-info.h"
|
||||||
|
|
||||||
|
#if GLIB_VERSION_MIN_REQUIRED < GLIB_VERSION_2_68
|
||||||
|
# undef G_DBUS_METHOD_INVOCATION_HANDLED
|
||||||
|
# define G_DBUS_METHOD_INVOCATION_HANDLED TRUE
|
||||||
|
#endif
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------------------------------------- */
|
||||||
|
|
||||||
static guint
|
static guint
|
||||||
@ -100,7 +105,7 @@ on_handle_hello_world (FooiGenBar *object,
|
|||||||
response = g_strdup_printf ("Word! You said '%s'. I'm Skeleton, btw!", greeting);
|
response = g_strdup_printf ("Word! You said '%s'. I'm Skeleton, btw!", greeting);
|
||||||
foo_igen_bar_complete_hello_world (object, invocation, response);
|
foo_igen_bar_complete_hello_world (object, invocation, response);
|
||||||
g_free (response);
|
g_free (response);
|
||||||
return TRUE;
|
return G_DBUS_METHOD_INVOCATION_HANDLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
@ -145,7 +150,7 @@ on_handle_test_primitive_types (FooiGenBar *object,
|
|||||||
g_free (s1);
|
g_free (s1);
|
||||||
g_free (s2);
|
g_free (s2);
|
||||||
g_free (s3);
|
g_free (s3);
|
||||||
return TRUE;
|
return G_DBUS_METHOD_INVOCATION_HANDLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
@ -185,7 +190,7 @@ on_handle_test_non_primitive_types (FooiGenBar *object,
|
|||||||
array_of_bytestrings,
|
array_of_bytestrings,
|
||||||
str->str);
|
str->str);
|
||||||
g_string_free (str, TRUE);
|
g_string_free (str, TRUE);
|
||||||
return TRUE;
|
return G_DBUS_METHOD_INVOCATION_HANDLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
@ -202,7 +207,7 @@ on_handle_request_signal_emission (FooiGenBar *object,
|
|||||||
foo_igen_bar_emit_test_signal (object, 43, a_strv, a_bytestring_array, a_variant); /* consumes a_variant */
|
foo_igen_bar_emit_test_signal (object, 43, a_strv, a_bytestring_array, a_variant); /* consumes a_variant */
|
||||||
foo_igen_bar_complete_request_signal_emission (object, invocation);
|
foo_igen_bar_complete_request_signal_emission (object, invocation);
|
||||||
}
|
}
|
||||||
return TRUE;
|
return G_DBUS_METHOD_INVOCATION_HANDLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
@ -218,7 +223,7 @@ on_handle_request_multi_property_mods (FooiGenBar *object,
|
|||||||
foo_igen_bar_set_y (object, foo_igen_bar_get_y (object) + 1);
|
foo_igen_bar_set_y (object, foo_igen_bar_get_y (object) + 1);
|
||||||
foo_igen_bar_set_i (object, foo_igen_bar_get_i (object) + 1);
|
foo_igen_bar_set_i (object, foo_igen_bar_get_i (object) + 1);
|
||||||
foo_igen_bar_complete_request_multi_property_mods (object, invocation);
|
foo_igen_bar_complete_request_multi_property_mods (object, invocation);
|
||||||
return TRUE;
|
return G_DBUS_METHOD_INVOCATION_HANDLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
@ -238,7 +243,7 @@ on_handle_property_cancellation (FooiGenBar *object,
|
|||||||
g_dbus_interface_skeleton_flush (G_DBUS_INTERFACE_SKELETON (object));
|
g_dbus_interface_skeleton_flush (G_DBUS_INTERFACE_SKELETON (object));
|
||||||
/* this makes us return the reply D-Bus method */
|
/* this makes us return the reply D-Bus method */
|
||||||
foo_igen_bar_complete_property_cancellation (object, invocation);
|
foo_igen_bar_complete_property_cancellation (object, invocation);
|
||||||
return TRUE;
|
return G_DBUS_METHOD_INVOCATION_HANDLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------------------------------------- */
|
||||||
@ -293,7 +298,7 @@ on_handle_force_method (FooiGenBat *object,
|
|||||||
g_variant_unref (ret_ay);
|
g_variant_unref (ret_ay);
|
||||||
g_variant_unref (ret_struct);
|
g_variant_unref (ret_struct);
|
||||||
|
|
||||||
return TRUE;
|
return G_DBUS_METHOD_INVOCATION_HANDLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -382,7 +387,7 @@ on_handle_check_not_authorized (FooiGenAuthorize *object,
|
|||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
foo_igen_authorize_complete_check_not_authorized (object, invocation);
|
foo_igen_authorize_complete_check_not_authorized (object, invocation);
|
||||||
return TRUE;
|
return G_DBUS_METHOD_INVOCATION_HANDLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
@ -391,7 +396,7 @@ on_handle_check_authorized (FooiGenAuthorize *object,
|
|||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
foo_igen_authorize_complete_check_authorized (object, invocation);
|
foo_igen_authorize_complete_check_authorized (object, invocation);
|
||||||
return TRUE;
|
return G_DBUS_METHOD_INVOCATION_HANDLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
@ -400,7 +405,7 @@ on_handle_check_not_authorized_from_object (FooiGenAuthorize *object,
|
|||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
foo_igen_authorize_complete_check_not_authorized_from_object (object, invocation);
|
foo_igen_authorize_complete_check_not_authorized_from_object (object, invocation);
|
||||||
return TRUE;
|
return G_DBUS_METHOD_INVOCATION_HANDLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------------------------------------- */
|
||||||
@ -414,7 +419,7 @@ on_handle_get_self (FooiGenMethodThreads *object,
|
|||||||
s = g_strdup_printf ("%p", (void *)g_thread_self ());
|
s = g_strdup_printf ("%p", (void *)g_thread_self ());
|
||||||
foo_igen_method_threads_complete_get_self (object, invocation, s);
|
foo_igen_method_threads_complete_get_self (object, invocation, s);
|
||||||
g_free (s);
|
g_free (s);
|
||||||
return TRUE;
|
return G_DBUS_METHOD_INVOCATION_HANDLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------------------------------------- */
|
||||||
@ -2645,7 +2650,7 @@ handle_hello_fd (FooiGenFDPassing *object,
|
|||||||
const gchar *arg_greeting)
|
const gchar *arg_greeting)
|
||||||
{
|
{
|
||||||
foo_igen_fdpassing_complete_hello_fd (object, invocation, fd_list, arg_greeting);
|
foo_igen_fdpassing_complete_hello_fd (object, invocation, fd_list, arg_greeting);
|
||||||
return TRUE;
|
return G_DBUS_METHOD_INVOCATION_HANDLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_64
|
#if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_64
|
||||||
@ -2657,7 +2662,7 @@ handle_no_annotation (FooiGenFDPassing *object,
|
|||||||
const gchar *arg_greeting_locale)
|
const gchar *arg_greeting_locale)
|
||||||
{
|
{
|
||||||
foo_igen_fdpassing_complete_no_annotation (object, invocation, fd_list, arg_greeting, arg_greeting_locale);
|
foo_igen_fdpassing_complete_no_annotation (object, invocation, fd_list, arg_greeting, arg_greeting_locale);
|
||||||
return TRUE;
|
return G_DBUS_METHOD_INVOCATION_HANDLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
@ -2667,7 +2672,7 @@ handle_no_annotation_nested (FooiGenFDPassing *object,
|
|||||||
GVariant *arg_files)
|
GVariant *arg_files)
|
||||||
{
|
{
|
||||||
foo_igen_fdpassing_complete_no_annotation_nested (object, invocation, fd_list);
|
foo_igen_fdpassing_complete_no_annotation_nested (object, invocation, fd_list);
|
||||||
return TRUE;
|
return G_DBUS_METHOD_INVOCATION_HANDLED;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
static gboolean
|
static gboolean
|
||||||
@ -2677,7 +2682,7 @@ handle_no_annotation (FooiGenFDPassing *object,
|
|||||||
const gchar *arg_greeting_locale)
|
const gchar *arg_greeting_locale)
|
||||||
{
|
{
|
||||||
foo_igen_fdpassing_complete_no_annotation (object, invocation, arg_greeting, arg_greeting_locale);
|
foo_igen_fdpassing_complete_no_annotation (object, invocation, arg_greeting, arg_greeting_locale);
|
||||||
return TRUE;
|
return G_DBUS_METHOD_INVOCATION_HANDLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
@ -2686,7 +2691,7 @@ handle_no_annotation_nested (FooiGenFDPassing *object,
|
|||||||
GVariant *arg_files)
|
GVariant *arg_files)
|
||||||
{
|
{
|
||||||
foo_igen_fdpassing_complete_no_annotation_nested (object, invocation);
|
foo_igen_fdpassing_complete_no_annotation_nested (object, invocation);
|
||||||
return TRUE;
|
return G_DBUS_METHOD_INVOCATION_HANDLED;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user