diff --git a/src/libnm-glib-aux/nm-dbus-aux.c b/src/libnm-glib-aux/nm-dbus-aux.c index be1444a01e..4ad8a111b6 100644 --- a/src/libnm-glib-aux/nm-dbus-aux.c +++ b/src/libnm-glib-aux/nm-dbus-aux.c @@ -526,39 +526,6 @@ nm_dbus_connection_call_blocking(NMDBusConnectionCallBlockingData *data, GError /*****************************************************************************/ -/** - * _nm_dbus_typecheck_response: - * @response: the #GVariant response to check. - * @reply_type: the expected reply type. It may be %NULL to perform no - * checking. - * @error: (allow-none): the error in case the @reply_type does not match. - * - * Returns: %TRUE, if @response is of the expected @reply_type. - */ -gboolean -_nm_dbus_typecheck_response(GVariant *response, const GVariantType *reply_type, GError **error) -{ - g_return_val_if_fail(response, FALSE); - - if (!reply_type) - return TRUE; - if (g_variant_is_of_type(response, reply_type)) - return TRUE; - - /* This is the same error code that g_dbus_connection_call() returns if - * @reply_type doesn't match. - */ - g_set_error(error, - G_IO_ERROR, - G_IO_ERROR_INVALID_ARGUMENT, - _("Method returned type '%s', but expected '%s'"), - g_variant_get_type_string(response), - g_variant_type_peek_string(reply_type)); - return FALSE; -} - -/*****************************************************************************/ - typedef struct { char *signal_name; const GVariantType *signature; @@ -694,6 +661,28 @@ _nm_dbus_proxy_signal_connect_data(GDBusProxy *proxy, /*****************************************************************************/ +static gboolean +_nm_dbus_typecheck_response(GVariant *response, const GVariantType *reply_type, GError **error) +{ + g_return_val_if_fail(response, FALSE); + + if (!reply_type) + return TRUE; + if (g_variant_is_of_type(response, reply_type)) + return TRUE; + + /* This is the same error code that g_dbus_connection_call() returns if + * @reply_type doesn't match. + */ + g_set_error(error, + G_IO_ERROR, + G_IO_ERROR_INVALID_ARGUMENT, + _("Method returned type '%s', but expected '%s'"), + g_variant_get_type_string(response), + g_variant_type_peek_string(reply_type)); + return FALSE; +} + /** * _nm_dbus_proxy_call_finish: * @proxy: A #GDBusProxy. @@ -723,17 +712,3 @@ _nm_dbus_proxy_call_finish(GDBusProxy *proxy, nm_clear_pointer(&variant, g_variant_unref); return variant; } - -GVariant * -_nm_dbus_connection_call_finish(GDBusConnection *dbus_connection, - GAsyncResult *result, - const GVariantType *reply_type, - GError **error) -{ - GVariant *variant; - - variant = g_dbus_connection_call_finish(dbus_connection, result, error); - if (variant && !_nm_dbus_typecheck_response(variant, reply_type, error)) - nm_clear_pointer(&variant, g_variant_unref); - return variant; -} diff --git a/src/libnm-glib-aux/nm-dbus-aux.h b/src/libnm-glib-aux/nm-dbus-aux.h index e3e3349546..5db79c08f7 100644 --- a/src/libnm-glib-aux/nm-dbus-aux.h +++ b/src/libnm-glib-aux/nm-dbus-aux.h @@ -276,9 +276,6 @@ nm_g_variant_tuple_get_u(GVariant *v, guint32 *out_u) /*****************************************************************************/ -gboolean -_nm_dbus_typecheck_response(GVariant *response, const GVariantType *reply_type, GError **error); - gulong _nm_dbus_proxy_signal_connect_data(GDBusProxy *proxy, const char *signal_name, const GVariantType *signature, @@ -313,9 +310,4 @@ GVariant *_nm_dbus_proxy_call_finish(GDBusProxy *proxy, const GVariantType *reply_type, GError **error); -GVariant *_nm_dbus_connection_call_finish(GDBusConnection *dbus_connection, - GAsyncResult *result, - const GVariantType *reply_type, - GError **error); - #endif /* __NM_DBUS_AUX_H__ */