Commit 869b4c68 authored by David Zeuthen's avatar David Zeuthen

GDBus: Use call() instead of invoke_method()

Lots of people been suggesting this. We still use MethodInvocation /
method_invocation for handling incoming method calls so use call()
instead of invoke_method() helps to separate the client and server
facilities. Which is a good thing(tm).
parent 728c4e38
......@@ -2361,10 +2361,10 @@ g_dbus_connection_get_guid
g_dbus_connection_get_unique_name
g_dbus_connection_get_capabilities
g_dbus_connection_get_peer_credentials
GDBusInvokeMethodFlags
g_dbus_connection_invoke_method
g_dbus_connection_invoke_method_finish
g_dbus_connection_invoke_method_sync
GDBusCallFlags
g_dbus_connection_call
g_dbus_connection_call_finish
g_dbus_connection_call_sync
g_dbus_connection_emit_signal
GDBusSignalCallback
g_dbus_connection_signal_subscribe
......@@ -2495,9 +2495,9 @@ g_dbus_proxy_get_cached_property_names
g_dbus_proxy_get_cached_property
g_dbus_proxy_set_interface_info
g_dbus_proxy_get_interface_info
g_dbus_proxy_invoke_method
g_dbus_proxy_invoke_method_finish
g_dbus_proxy_invoke_method_sync
g_dbus_proxy_call
g_dbus_proxy_call_finish
g_dbus_proxy_call_sync
<SUBSECTION Standard>
G_DBUS_PROXY
G_IS_DBUS_PROXY
......
......@@ -55,9 +55,9 @@
<row><entry>dbus_g_connection_unregister_g_object()</entry><entry>g_dbus_connection_unregister_object()</entry></row>
<row><entry>dbus_g_object_type_install_info()</entry><entry>introspection data is installed while registering
an object, see g_dbus_connection_register_object()</entry></row>
<row><entry>dbus_g_proxy_begin_call()</entry><entry>g_dbus_proxy_invoke_method()</entry></row>
<row><entry>dbus_g_proxy_end_call()</entry><entry>g_dbus_proxy_invoke_method_finish()</entry></row>
<row><entry>dbus_g_proxy_call()</entry><entry>g_dbus_proxy_invoke_method_sync()</entry></row>
<row><entry>dbus_g_proxy_begin_call()</entry><entry>g_dbus_proxy_call()</entry></row>
<row><entry>dbus_g_proxy_end_call()</entry><entry>g_dbus_proxy_call_finish()</entry></row>
<row><entry>dbus_g_proxy_call()</entry><entry>g_dbus_proxy_call_sync()</entry></row>
<row><entry>dbus_g_error_domain_register()</entry><entry>g_dbus_error_register_error_domain()</entry></row>
<row><entry>dbus_g_error_has_name()</entry><entry>no direct equivalent, see g_dbus_error_get_remote_error()</entry></row>
<row><entry>dbus_g_method_return()</entry><entry>g_dbus_method_invocation_return_value()</entry></row>
......
......@@ -143,16 +143,16 @@ print_methods (GDBusConnection *c,
guint m;
error = NULL;
result = g_dbus_connection_invoke_method_sync (c,
name,
path,
"org.freedesktop.DBus.Introspectable",
"Introspect",
NULL,
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
3000, /* 3 secs */
NULL,
&error);
result = g_dbus_connection_call_sync (c,
name,
path,
"org.freedesktop.DBus.Introspectable",
"Introspect",
NULL,
G_DBUS_CALL_FLAGS_NONE,
3000, /* 3 secs */
NULL,
&error);
if (result == NULL)
{
g_printerr (_("Error: %s\n"), error->message);
......@@ -205,16 +205,16 @@ print_paths (GDBusConnection *c,
guint n;
error = NULL;
result = g_dbus_connection_invoke_method_sync (c,
name,
path,
"org.freedesktop.DBus.Introspectable",
"Introspect",
NULL,
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
3000, /* 3 secs */
NULL,
&error);
result = g_dbus_connection_call_sync (c,
name,
path,
"org.freedesktop.DBus.Introspectable",
"Introspect",
NULL,
G_DBUS_CALL_FLAGS_NONE,
3000, /* 3 secs */
NULL,
&error);
if (result == NULL)
{
g_printerr (_("Error: %s\n"), error->message);
......@@ -283,16 +283,16 @@ print_names (GDBusConnection *c,
name_set = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
error = NULL;
result = g_dbus_connection_invoke_method_sync (c,
"org.freedesktop.DBus",
"/org/freedesktop/DBus",
"org.freedesktop.DBus",
"ListNames",
NULL,
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
3000, /* 3 secs */
NULL,
&error);
result = g_dbus_connection_call_sync (c,
"org.freedesktop.DBus",
"/org/freedesktop/DBus",
"org.freedesktop.DBus",
"ListNames",
NULL,
G_DBUS_CALL_FLAGS_NONE,
3000, /* 3 secs */
NULL,
&error);
if (result == NULL)
{
g_printerr (_("Error: %s\n"), error->message);
......@@ -312,16 +312,16 @@ print_names (GDBusConnection *c,
g_variant_unref (result);
error = NULL;
result = g_dbus_connection_invoke_method_sync (c,
"org.freedesktop.DBus",
"/org/freedesktop/DBus",
"org.freedesktop.DBus",
"ListActivatableNames",
NULL,
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
3000, /* 3 secs */
NULL,
&error);
result = g_dbus_connection_call_sync (c,
"org.freedesktop.DBus",
"/org/freedesktop/DBus",
"org.freedesktop.DBus",
"ListActivatableNames",
NULL,
G_DBUS_CALL_FLAGS_NONE,
3000, /* 3 secs */
NULL,
&error);
if (result == NULL)
{
g_printerr (_("Error: %s\n"), error->message);
......@@ -453,16 +453,16 @@ call_helper_get_method_in_signature (GDBusConnection *c,
result = NULL;
node_info = NULL;
result = g_dbus_connection_invoke_method_sync (c,
dest,
path,
"org.freedesktop.DBus.Introspectable",
"Introspect",
NULL,
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
3000, /* 3 secs */
NULL,
error);
result = g_dbus_connection_call_sync (c,
dest,
path,
"org.freedesktop.DBus.Introspectable",
"Introspect",
NULL,
G_DBUS_CALL_FLAGS_NONE,
3000, /* 3 secs */
NULL,
error);
if (result == NULL)
goto out;
......@@ -825,16 +825,16 @@ handle_call (gint *argc,
if (parameters != NULL)
parameters = g_variant_ref_sink (parameters);
result = g_dbus_connection_invoke_method_sync (c,
opt_call_dest,
opt_call_object_path,
interface_name,
method_name,
parameters,
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
-1,
NULL,
&error);
result = g_dbus_connection_call_sync (c,
opt_call_dest,
opt_call_object_path,
interface_name,
method_name,
parameters,
G_DBUS_CALL_FLAGS_NONE,
-1,
NULL,
&error);
if (result == NULL)
{
g_printerr (_("Error: %s\n"), error->message);
......@@ -1011,16 +1011,16 @@ dump_interface (GDBusConnection *c,
if (c != NULL && name != NULL && object_path != NULL)
{
GVariant *result;
result = g_dbus_connection_invoke_method_sync (c,
name,
object_path,
"org.freedesktop.DBus.Properties",
"GetAll",
g_variant_new ("(s)", o->name),
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
3000,
NULL,
NULL);
result = g_dbus_connection_call_sync (c,
name,
object_path,
"org.freedesktop.DBus.Properties",
"GetAll",
g_variant_new ("(s)", o->name),
G_DBUS_CALL_FLAGS_NONE,
3000,
NULL,
NULL);
if (result != NULL)
{
if (g_variant_is_of_type (result, G_VARIANT_TYPE ("(a{sv})")))
......@@ -1259,16 +1259,16 @@ handle_introspect (gint *argc,
if (request_completion)
goto out;
result = g_dbus_connection_invoke_method_sync (c,
opt_introspect_dest,
opt_introspect_object_path,
"org.freedesktop.DBus.Introspectable",
"Introspect",
NULL,
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
3000, /* 3 sec */
NULL,
&error);
result = g_dbus_connection_call_sync (c,
opt_introspect_dest,
opt_introspect_object_path,
"org.freedesktop.DBus.Introspectable",
"Introspect",
NULL,
G_DBUS_CALL_FLAGS_NONE,
3000, /* 3 sec */
NULL,
&error);
if (result == NULL)
{
g_printerr (_("Error: %s\n"), error->message);
......
......@@ -351,7 +351,7 @@ mechanism_client_initiate (GDBusAuthMechanism *mechanism,
/* return the uid */
#if defined(G_OS_UNIX)
initial_response = g_strdup_printf ("%" G_GINT64_FORMAT, g_credentials_get_unix_user (credentials, NULL));
initial_response = g_strdup_printf ("%" G_GINT64_FORMAT, (gint64) g_credentials_get_unix_user (credentials, NULL));
#elif defined(G_OS_WIN32)
initial_response = g_strdup_printf ("%s", g_credentials_get_windows_user ());
#else
......
......@@ -1802,16 +1802,16 @@ initable_init (GInitable *initable,
GVariant *hello_result;
const gchar *s;
hello_result = g_dbus_connection_invoke_method_sync (connection,
"org.freedesktop.DBus", /* name */
"/org/freedesktop/DBus", /* path */
"org.freedesktop.DBus", /* interface */
"Hello",
NULL, /* parameters */
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
-1,
NULL, /* TODO: cancellable */
&connection->priv->initialization_error);
hello_result = g_dbus_connection_call_sync (connection,
"org.freedesktop.DBus", /* name */
"/org/freedesktop/DBus", /* path */
"org.freedesktop.DBus", /* interface */
"Hello",
NULL, /* parameters */
G_DBUS_CALL_FLAGS_NONE,
-1,
NULL, /* TODO: cancellable */
&connection->priv->initialization_error);
if (hello_result == NULL)
goto out;
......@@ -2274,7 +2274,7 @@ static guint _global_filter_id = 1;
* worker thread. Also note that filters are rarely needed - use API
* such as g_dbus_connection_send_message_with_reply(),
* g_dbus_connection_signal_subscribe() or
* g_dbus_connection_invoke_method() instead.
* g_dbus_connection_call() instead.
*
* Returns: A filter identifier that can be used with
* g_dbus_connection_remove_filter().
......@@ -3646,7 +3646,7 @@ handle_introspect (GDBusConnection *connection,
/* called in thread where object was registered - no locks held */
static gboolean
invoke_method_in_idle_cb (gpointer user_data)
call_in_idle_cb (gpointer user_data)
{
GDBusMethodInvocation *invocation = G_DBUS_METHOD_INVOCATION (user_data);
GDBusInterfaceVTable *vtable;
......@@ -3753,7 +3753,7 @@ validate_and_maybe_schedule_method_call (GDBusConnection *connection,
idle_source = g_idle_source_new ();
g_source_set_priority (idle_source, G_PRIORITY_DEFAULT);
g_source_set_callback (idle_source,
invoke_method_in_idle_cb,
call_in_idle_cb,
invocation,
g_object_unref);
g_source_attach (idle_source, main_context);
......@@ -4068,22 +4068,22 @@ g_dbus_connection_emit_signal (GDBusConnection *connection,
}
static void
add_invoke_method_flags (GDBusMessage *message,
GDBusInvokeMethodFlags flags)
add_call_flags (GDBusMessage *message,
GDBusCallFlags flags)
{
if (flags & G_DBUS_INVOKE_METHOD_FLAGS_NO_AUTO_START)
if (flags & G_DBUS_CALL_FLAGS_NO_AUTO_START)
g_dbus_message_set_flags (message, G_DBUS_MESSAGE_FLAGS_NO_AUTO_START);
}
/**
* g_dbus_connection_invoke_method:
* g_dbus_connection_call:
* @connection: A #GDBusConnection.
* @bus_name: A unique or well-known bus name or %NULL if @connection is not a message bus connection.
* @object_path: Path of remote object.
* @interface_name: D-Bus interface to invoke method on.
* @method_name: The name of the method to invoke.
* @parameters: A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
* @flags: Flags from the #GDBusInvokeMethodFlags enumeration.
* @flags: Flags from the #GDBusCallFlags enumeration.
* @timeout_msec: The timeout in milliseconds or -1 to use the default timeout.
* @cancellable: A #GCancellable or %NULL.
* @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't
......@@ -4103,24 +4103,24 @@ add_invoke_method_flags (GDBusMessage *message,
* This is an asynchronous method. When the operation is finished, @callback will be invoked
* in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
* of the thread you are calling this method from. You can then call
* g_dbus_connection_invoke_method_finish() to get the result of the operation.
* See g_dbus_connection_invoke_method_sync() for the synchronous version of this
* g_dbus_connection_call_finish() to get the result of the operation.
* See g_dbus_connection_call_sync() for the synchronous version of this
* function.
*
* Since: 2.26
*/
void
g_dbus_connection_invoke_method (GDBusConnection *connection,
const gchar *bus_name,
const gchar *object_path,
const gchar *interface_name,
const gchar *method_name,
GVariant *parameters,
GDBusInvokeMethodFlags flags,
gint timeout_msec,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
g_dbus_connection_call (GDBusConnection *connection,
const gchar *bus_name,
const gchar *object_path,
const gchar *interface_name,
const gchar *method_name,
GVariant *parameters,
GDBusCallFlags flags,
gint timeout_msec,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
{
GDBusMessage *message;
......@@ -4136,7 +4136,7 @@ g_dbus_connection_invoke_method (GDBusConnection *connection,
object_path,
interface_name,
method_name);
add_invoke_method_flags (message, flags);
add_call_flags (message, flags);
if (parameters != NULL)
g_dbus_message_set_body (message, parameters);
......@@ -4187,12 +4187,12 @@ decode_method_reply (GDBusMessage *reply,
}
/**
* g_dbus_connection_invoke_method_finish:
* g_dbus_connection_call_finish:
* @connection: A #GDBusConnection.
* @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_invoke_method().
* @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_call().
* @error: Return location for error or %NULL.
*
* Finishes an operation started with g_dbus_connection_invoke_method().
* Finishes an operation started with g_dbus_connection_call().
*
* Returns: %NULL if @error is set. Otherwise a #GVariant tuple with
* return values. Free with g_variant_unref().
......@@ -4200,9 +4200,9 @@ decode_method_reply (GDBusMessage *reply,
* Since: 2.26
*/
GVariant *
g_dbus_connection_invoke_method_finish (GDBusConnection *connection,
GAsyncResult *res,
GError **error)
g_dbus_connection_call_finish (GDBusConnection *connection,
GAsyncResult *res,
GError **error)
{
GDBusMessage *reply;
GVariant *result;
......@@ -4228,14 +4228,14 @@ g_dbus_connection_invoke_method_finish (GDBusConnection *connection,
/* ---------------------------------------------------------------------------------------------------- */
/**
* g_dbus_connection_invoke_method_sync:
* g_dbus_connection_call_sync:
* @connection: A #GDBusConnection.
* @bus_name: A unique or well-known bus name.
* @object_path: Path of remote object.
* @interface_name: D-Bus interface to invoke method on.
* @method_name: The name of the method to invoke.
* @parameters: A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
* @flags: Flags from the #GDBusInvokeMethodFlags enumeration.
* @flags: Flags from the #GDBusCallFlags enumeration.
* @timeout_msec: The timeout in milliseconds or -1 to use the default timeout.
* @cancellable: A #GCancellable or %NULL.
* @error: Return location for error or %NULL.
......@@ -4251,7 +4251,7 @@ g_dbus_connection_invoke_method_finish (GDBusConnection *connection,
* fails with %G_IO_ERROR_INVALID_ARGUMENT.
*
* The calling thread is blocked until a reply is received. See
* g_dbus_connection_invoke_method() for the asynchronous version of
* g_dbus_connection_call() for the asynchronous version of
* this method.
*
* Returns: %NULL if @error is set. Otherwise a #GVariant tuple with
......@@ -4260,16 +4260,16 @@ g_dbus_connection_invoke_method_finish (GDBusConnection *connection,
* Since: 2.26
*/
GVariant *
g_dbus_connection_invoke_method_sync (GDBusConnection *connection,
const gchar *bus_name,
const gchar *object_path,
const gchar *interface_name,
const gchar *method_name,
GVariant *parameters,
GDBusInvokeMethodFlags flags,
gint timeout_msec,
GCancellable *cancellable,
GError **error)
g_dbus_connection_call_sync (GDBusConnection *connection,
const gchar *bus_name,
const gchar *object_path,
const gchar *interface_name,
const gchar *method_name,
GVariant *parameters,
GDBusCallFlags flags,
gint timeout_msec,
GCancellable *cancellable,
GError **error)
{
GDBusMessage *message;
GDBusMessage *reply;
......@@ -4291,7 +4291,7 @@ g_dbus_connection_invoke_method_sync (GDBusConnection *connection,
object_path,
interface_name,
method_name);
add_invoke_method_flags (message, flags);
add_call_flags (message, flags);
if (parameters != NULL)
g_dbus_message_set_body (message, parameters);
......
......@@ -171,27 +171,27 @@ gboolean g_dbus_connection_emit_signal (GDBusConnection
const gchar *signal_name,
GVariant *parameters,
GError **error);
void g_dbus_connection_invoke_method (GDBusConnection *connection,
void g_dbus_connection_call (GDBusConnection *connection,
const gchar *bus_name,
const gchar *object_path,
const gchar *interface_name,
const gchar *method_name,
GVariant *parameters,
GDBusInvokeMethodFlags flags,
GDBusCallFlags flags,
gint timeout_msec,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
GVariant *g_dbus_connection_invoke_method_finish (GDBusConnection *connection,
GVariant *g_dbus_connection_call_finish (GDBusConnection *connection,
GAsyncResult *res,
GError **error);
GVariant *g_dbus_connection_invoke_method_sync (GDBusConnection *connection,
GVariant *g_dbus_connection_call_sync (GDBusConnection *connection,
const gchar *bus_name,
const gchar *object_path,
const gchar *interface_name,
const gchar *method_name,
GVariant *parameters,
GDBusInvokeMethodFlags flags,
GDBusCallFlags flags,
gint timeout_msec,
GCancellable *cancellable,
GError **error);
......
......@@ -41,9 +41,9 @@
* @include: gio/gio.h
*
* All facilities that return errors from remote methods (such as
* g_dbus_connection_invoke_method_sync()) use #GError to represent
* both D-Bus errors (e.g. errors returned from the other peer) and
* locally in-process generated errors.
* g_dbus_connection_call_sync()) use #GError to represent both D-Bus
* errors (e.g. errors returned from the other peer) and locally
* in-process generated errors.
*
* To check if a returned #GError is an error from a remote peer, use
* g_dbus_error_is_remote_error(). To get the actual D-Bus error name,
......@@ -488,9 +488,10 @@ g_dbus_error_is_remote_error (const GError *error)
*
* Gets the D-Bus error name used for @error, if any.
*
* This function is guaranteed to return a D-Bus error name for all #GError<!-- -->s returned from
* functions handling remote method calls (e.g. g_dbus_connection_invoke_method_finish())
* unless g_dbus_error_strip_remote_error() has been used on @error.
* This function is guaranteed to return a D-Bus error name for all
* #GError<!-- -->s returned from functions handling remote method
* calls (e.g. g_dbus_connection_call_finish()) unless
* g_dbus_error_strip_remote_error() has been used on @error.
*
* Returns: An allocated string or %NULL if the D-Bus error name could not be found. Free with g_free().
*
......
......@@ -294,9 +294,9 @@ request_name_cb (GObject *source_object,
request_name_reply = 0;
result = NULL;
result = g_dbus_connection_invoke_method_finish (client->connection,
res,
NULL);
result = g_dbus_connection_call_finish (client->connection,
res,
NULL);
if (result != NULL)
{
g_variant_get (result, "(u)", &request_name_reply);
......@@ -395,19 +395,19 @@ has_connection (Client *client)
client);
/* attempt to acquire the name */
g_dbus_connection_invoke_method (client->connection,
"org.freedesktop.DBus", /* bus name */
"/org/freedesktop/DBus", /* object path */
"org.freedesktop.DBus", /* interface name */
"RequestName", /* method name */
g_variant_new ("(su)",
client->name,
client->flags),
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
-1,
NULL,
(GAsyncReadyCallback) request_name_cb,
client_ref (client));
g_dbus_connection_call (client->connection,
"org.freedesktop.DBus", /* bus name */
"/org/freedesktop/DBus", /* object path */
"org.freedesktop.DBus", /* interface name */
"RequestName", /* method name */
g_variant_new ("(su)",
client->name,
client->flags),
G_DBUS_CALL_FLAGS_NONE,
-1,
NULL,
(GAsyncReadyCallback) request_name_cb,
client_ref (client));
}
......@@ -676,16 +676,16 @@ g_bus_unown_name (guint owner_id)
* I believe this is a bug in the bus daemon.
*/
error = NULL;
result = g_dbus_connection_invoke_method_sync (client->connection,
"org.freedesktop.DBus", /* bus name */
"/org/freedesktop/DBus", /* object path */
"org.freedesktop.DBus", /* interface name */
"ReleaseName", /* method name */
g_variant_new ("(s)", client->name),
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
-1,
NULL,
&error);
result = g_dbus_connection_call_sync (client->connection,
"org.freedesktop.DBus", /* bus name */
"/org/freedesktop/DBus", /* object path */
"org.freedesktop.DBus", /* interface name */
"ReleaseName", /* method name */
g_variant_new ("(s)", client->name),
G_DBUS_CALL_FLAGS_NONE,
-1,
NULL,
&error);
if (result == NULL)
{
g_warning ("Error releasing name %s: %s", client->name, error->message);
......
......@@ -331,9 +331,9 @@ get_name_owner_cb (GObject *source_object,
name_owner = NULL;
result = NULL;
result = g_dbus_connection_invoke_method_finish (client->connection,
res,
NULL);
result = g_dbus_connection_call_finish (client->connection,
res,
NULL);
if (result != NULL)
{
g_variant_get (result, "(s)", &name_owner);
......@@ -362,17 +362,17 @@ get_name_owner_cb (GObject *source_object,
static void
invoke_get_name_owner (Client *client)
{
g_dbus_connection_invoke_method (client->connection,
"org.freedesktop.DBus", /* bus name */
"/org/freedesktop/DBus", /* object path */
"org.freedesktop.DBus", /* interface name */
"GetNameOwner", /* method name */
g_variant_new ("(s)", client->name),
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
-1,
NULL,
(GAsyncReadyCallback) get_name_owner_cb,
client_ref (client));
g_dbus_connection_call (client->connection,
"org.freedesktop.DBus", /* bus name */
"/org/freedesktop/DBus", /* object path */
"org.freedesktop.DBus", /* interface name */
"GetNameOwner", /* method name */
g_variant_new ("(s)", client->name),
G_DBUS_CALL_FLAGS_NONE,
-1,
NULL,
(GAsyncReadyCallback) get_name_owner_cb,
client_ref (client));
}
/* ---------------------------------------------------------------------------------------------------- */
......@@ -387,9 +387,9 @@ start_service_by_name_cb (GObject *source_object,
result = NULL;
result = g_dbus_connection_invoke_method_finish (client->connection,
res,
NULL);
result = g_dbus_connection_call_finish (client->connection,
res,
NULL);
if (result != NULL)
{
guint32 start_service_result;
......@@ -452,17 +452,17 @@ has_connection (Client *client)
if (client->flags & G_BUS_NAME_WATCHER_FLAGS_AUTO_START)
{
g_dbus_connection_invoke_method (client->connection,
"org.freedesktop.DBus", /* bus name */
"/org/freedesktop/DBus", /* object path */
"org.freedesktop.DBus", /* interface name */
"StartServiceByName", /* method name */
g_variant_new ("(su)", client->name, 0),
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
-1,
NULL,
(GAsyncReadyCallback) start_service_by_name_cb,
client_ref (client));
g_dbus_connection_call (client->connection,
"org.freedesktop.DBus", /* bus name */
"/org/freedesktop/DBus", /* object path */
"org.freedesktop.DBus", /* interface name */
"StartServiceByName", /* method name */
g_variant_new ("(su)", client->name, 0),
G_DBUS_CALL_FLAGS_NONE,
-1,
NULL,
(GAsyncReadyCallback) start_service_by_name_cb,
client_ref (client));
}
else
{
......
......@@ -359,8 +359,8 @@ g_dbus_proxy_class_init (GDBusProxyClass *klass)
* GDBusProxy:g-default-timeout:
*
* The timeout to use if -1 (specifying default timeout) is passed
* as @timeout_msec in the g_dbus_proxy_invoke_method() and
* g_dbus_proxy_invoke_method_sync() functions.
* as @timeout_msec in the g_dbus_proxy_call() and
* g_dbus_proxy_call_sync() functions.
*
* This allows applications to set a proxy-wide timeout for all
* remote method invocations on the proxy. If this property is -1,
......@@ -752,16 +752,16 @@ initable_init (GInitable *initable,
if (!(proxy->priv->flags & G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES))
{
/* load all properties synchronously */
result = g_dbus_connection_invoke_method_sync (proxy->priv->connection,
proxy->priv->unique_bus_name,
proxy->priv->object_path,
"org.freedesktop.DBus.Properties",
"GetAll",
g_variant_new ("(s)", proxy->priv->interface_name),
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
-1, /* timeout */
cancellable,
error);
result = g_dbus_connection_call_sync (proxy->priv->connection,
proxy->priv->unique_bus_name,
proxy->priv->object_path,
"org.freedesktop.DBus.Properties",
"GetAll",
g_variant_new ("(s)", proxy->priv->interface_name),
G_DBUS_CALL_FLAGS_NONE,
-1, /* timeout */
cancellable,
error);
if (result == NULL)