summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2020-03-23 09:47:17 +0100
committerThomas Haller <thaller@redhat.com>2020-03-23 09:47:17 +0100
commitc50b4621d4415f9156e969a6a05fb37e1bb02e18 (patch)
treec9e6332e19a5fcf18194dc638c17456d2f201ecc
parent2686de2edef67ddd6e25602643067127e1886be1 (diff)
parent431c349b473d01351f0cc9e413405eac1bf04624 (diff)
downloadNetworkManager-c50b4621d4415f9156e969a6a05fb37e1bb02e18.tar.gz
libnm: merge branch 'th/libnm-dbus-async-calls'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/439
-rw-r--r--clients/cli/general.c102
-rw-r--r--libnm-core/nm-setting-gsm.c4
-rw-r--r--libnm-core/nm-setting-wireless.c2
-rw-r--r--libnm-core/nm-utils.c2
-rw-r--r--libnm-core/nm-version.h9
-rw-r--r--libnm/libnm.ver4
-rw-r--r--libnm/nm-access-point.c2
-rw-r--r--libnm/nm-client.c215
-rw-r--r--libnm/nm-client.h35
-rw-r--r--libnm/nm-device-6lowpan.c2
-rw-r--r--libnm/nm-device-bond.c2
-rw-r--r--libnm/nm-device-bridge.c2
-rw-r--r--libnm/nm-device-bt.c2
-rw-r--r--libnm/nm-device-dummy.c2
-rw-r--r--libnm/nm-device-ethernet.c2
-rw-r--r--libnm/nm-device-generic.c2
-rw-r--r--libnm/nm-device-infiniband.c2
-rw-r--r--libnm/nm-device-macsec.c2
-rw-r--r--libnm/nm-device-macvlan.c2
-rw-r--r--libnm/nm-device-olpc-mesh.c2
-rw-r--r--libnm/nm-device-team.c2
-rw-r--r--libnm/nm-device-tun.c2
-rw-r--r--libnm/nm-device-vlan.c2
-rw-r--r--libnm/nm-device-vxlan.c2
-rw-r--r--libnm/nm-device-wifi-p2p.c2
-rw-r--r--libnm/nm-device-wifi.c6
-rw-r--r--libnm/nm-device-wimax.h2
-rw-r--r--libnm/nm-device-wpan.c2
-rw-r--r--libnm/nm-device.c21
-rw-r--r--libnm/nm-libnm-utils.h6
-rw-r--r--libnm/nm-remote-connection.c8
-rw-r--r--libnm/nm-secret-agent-old.c8
-rw-r--r--libnm/nm-vpn-plugin-old.c28
-rw-r--r--libnm/nm-wimax-nsp.c16
-rw-r--r--libnm/nm-wimax-nsp.h2
-rw-r--r--shared/nm-glib-aux/nm-dbus-aux.c6
36 files changed, 394 insertions, 118 deletions
diff --git a/clients/cli/general.c b/clients/cli/general.c
index 53b5e6d40e..2cc86aaaf2 100644
--- a/clients/cli/general.c
+++ b/clients/cli/general.c
@@ -731,11 +731,26 @@ nmc_complete_strings_nocase (const char *prefix, ...)
va_end (args);
}
-static NMCResultCode
-do_general_logging (NmCli *nmc, int argc, char **argv)
+static void
+_set_logging_cb (GObject *object, GAsyncResult *result, gpointer user_data)
{
+ NmCli *nmc = user_data;
+ gs_unref_variant GVariant *res = NULL;
gs_free_error GError *error = NULL;
+ res = nm_client_dbus_call_finish (NM_CLIENT (object), result, &error);
+ if (!res) {
+ g_dbus_error_strip_remote_error (error);
+ g_string_printf (nmc->return_text, _("Error: failed to set logging: %s"),
+ nmc_error_get_simple_message (error));
+ nmc->return_value = NMC_RESULT_ERROR_UNKNOWN;
+ }
+ quit ();
+}
+
+static NMCResultCode
+do_general_logging (NmCli *nmc, int argc, char **argv)
+{
next_arg (nmc, &argc, &argv, NULL);
if (argc == 0) {
if (nmc->complete)
@@ -789,12 +804,19 @@ do_general_logging (NmCli *nmc, int argc, char **argv)
if (nmc->complete)
return nmc->return_value;
- nm_client_set_logging (nmc->client, level, domains, &error);
- if (error) {
- g_string_printf (nmc->return_text, _("Error: failed to set logging: %s"),
- nmc_error_get_simple_message (error));
- return NMC_RESULT_ERROR_UNKNOWN;
- }
+ nmc->should_wait++;
+ nm_client_dbus_call (nmc->client,
+ NM_DBUS_PATH,
+ NM_DBUS_INTERFACE,
+ "SetLogging",
+ g_variant_new ("(ss)",
+ level ?: "",
+ domains ?: ""),
+ G_VARIANT_TYPE ("()"),
+ -1,
+ NULL,
+ _set_logging_cb,
+ nmc);
}
return nmc->return_value;
@@ -911,16 +933,48 @@ nmc_switch_parse_on_off (NmCli *nmc, const char *arg1, const char *arg2, gboolea
return TRUE;
}
+static void
+_do_networking_on_off_cb (GObject *object, GAsyncResult *result, gpointer user_data)
+{
+ NmCli *nmc = user_data;
+ gs_unref_variant GVariant *ret = NULL;
+ gs_free_error GError *error = NULL;
+
+ ret = nm_client_dbus_call_finish (NM_CLIENT (object), result, &error);
+ if (!ret) {
+ if (g_error_matches (error,
+ NM_MANAGER_ERROR,
+ NM_MANAGER_ERROR_ALREADY_ENABLED_OR_DISABLED)) {
+ /* This is fine. Be quiet about it. */
+ } else {
+ g_dbus_error_strip_remote_error (error);
+ g_string_printf (nmc->return_text, _("Error: failed to set networking: %s"),
+ nmc_error_get_simple_message (error));
+ nmc->return_value = NMC_RESULT_ERROR_UNKNOWN;
+ }
+ }
+ quit ();
+}
+
static NMCResultCode
do_networking_on_off (NmCli *nmc, int argc, char **argv, gboolean enable)
{
if (nmc->complete)
return nmc->return_value;
- /* Register polkit agent */
nmc_start_polkit_agent_start_try (nmc);
- nm_client_networking_set_enabled (nmc->client, enable, NULL);
+ nmc->should_wait++;
+ nm_client_dbus_call (nmc->client,
+ NM_DBUS_PATH,
+ NM_DBUS_INTERFACE,
+ "Enable",
+ g_variant_new ("(b)", enable),
+ G_VARIANT_TYPE ("()"),
+ -1,
+ NULL,
+ _do_networking_on_off_cb,
+ nmc);
return nmc->return_value;
}
@@ -1034,6 +1088,21 @@ do_radio_all (NmCli *nmc, int argc, char **argv)
return nmc->return_value;
}
+static void
+_do_radio_wifi_cb (GObject *object, GAsyncResult *result, gpointer user_data)
+{
+ NmCli *nmc = user_data;
+ gs_free_error GError *error = NULL;
+
+ if (!nm_client_dbus_set_property_finish (NM_CLIENT (object), result, &error)) {
+ g_dbus_error_strip_remote_error (error);
+ g_string_printf (nmc->return_text, _("Error: failed to set Wi-Fi radio: %s"),
+ nmc_error_get_simple_message (error));
+ nmc->return_value = NMC_RESULT_ERROR_UNKNOWN;
+ }
+ quit ();
+}
+
static NMCResultCode
do_radio_wifi (NmCli *nmc, int argc, char **argv)
{
@@ -1055,7 +1124,18 @@ do_radio_wifi (NmCli *nmc, int argc, char **argv)
if (!nmc_switch_parse_on_off (nmc, *(argv-1), *argv, &enable_flag))
return nmc->return_value;
- nm_client_wireless_set_enabled (nmc->client, enable_flag);
+ nmc_start_polkit_agent_start_try (nmc);
+
+ nmc->should_wait++;
+ nm_client_dbus_set_property (nmc->client,
+ NM_DBUS_PATH,
+ NM_DBUS_INTERFACE,
+ "WirelessEnabled",
+ g_variant_new_boolean (enable_flag),
+ -1,
+ NULL,
+ _do_radio_wifi_cb,
+ nmc);
}
return nmc->return_value;
diff --git a/libnm-core/nm-setting-gsm.c b/libnm-core/nm-setting-gsm.c
index 1a72e17ad4..19e2554a9a 100644
--- a/libnm-core/nm-setting-gsm.c
+++ b/libnm-core/nm-setting-gsm.c
@@ -85,7 +85,7 @@ nm_setting_gsm_get_auto_config (NMSettingGsm *setting)
*
* Returns: the #NMSettingGsm:number property of the setting
*
- * Deprecated: 1.16: user-provided values for this setting are no longer used.
+ * Deprecated: 1.16: User-provided values for this setting are no longer used.
**/
const char *
nm_setting_gsm_get_number (NMSettingGsm *setting)
@@ -659,7 +659,7 @@ nm_setting_gsm_class_init (NMSettingGsmClass *klass)
* Legacy setting that used to help establishing PPP data sessions for
* GSM-based modems.
*
- * Deprecated: 1.16: user-provided values for this setting are no longer used.
+ * Deprecated: 1.16: User-provided values for this setting are no longer used.
**/
obj_properties[PROP_NUMBER] =
g_param_spec_string (NM_SETTING_GSM_NUMBER, "", "",
diff --git a/libnm-core/nm-setting-wireless.c b/libnm-core/nm-setting-wireless.c
index 78c1393a5a..2ef51088ea 100644
--- a/libnm-core/nm-setting-wireless.c
+++ b/libnm-core/nm-setting-wireless.c
@@ -1708,7 +1708,7 @@ nm_setting_wireless_class_init (NMSettingWirelessClass *klass)
* 'cloned-mac-address'.
*
* Since: 1.2
- * Deprecated: 1.4: Deprecated by NMSettingWireless:cloned-mac-address property
+ * Deprecated: 1.4: Deprecated by NMSettingWireless:cloned-mac-address property.
**/
/* ---ifcfg-rh---
* property: mac-address-randomization
diff --git a/libnm-core/nm-utils.c b/libnm-core/nm-utils.c
index ce4869acc5..2e4b0ceb44 100644
--- a/libnm-core/nm-utils.c
+++ b/libnm-core/nm-utils.c
@@ -4729,7 +4729,7 @@ nm_utils_is_valid_iface_name (const char *name, GError **error)
*
* Validate the network interface name.
*
- * Deprecated: 1.6: use nm_utils_is_valid_iface_name() instead, with better error reporting.
+ * Deprecated: 1.6: Use nm_utils_is_valid_iface_name() instead, with better error reporting.
*
* Returns: %TRUE if interface name is valid, otherwise %FALSE is returned.
*
diff --git a/libnm-core/nm-version.h b/libnm-core/nm-version.h
index e8a94db648..195fc19684 100644
--- a/libnm-core/nm-version.h
+++ b/libnm-core/nm-version.h
@@ -249,10 +249,11 @@
* around g_dbus_connection_call_sync(). You may call it directly
* without feeling dirty.
*
- * We don't want to force users away from this API, for that reason the
- * macro does not yet expand to G_DEPRECATED.
+ * The API is marked as deprecated since 1.22, however the macro only starts
+ * complaining in 1.24. That's intentional, because in 1.22 the asynchronous
+ * alternative was not yet available.
*/
-#define _NM_DEPRECATED_SYNC_METHOD /*NM_DEPRECATED_IN_1_22*/
-#define _NM_DEPRECATED_SYNC_WRITABLE_PROPERTY /*NM_DEPRECATED_IN_1_22*/
+#define _NM_DEPRECATED_SYNC_METHOD NM_DEPRECATED_IN_1_24
+#define _NM_DEPRECATED_SYNC_WRITABLE_PROPERTY /* NM_DEPRECATED_IN_1_22 */
#endif /* NM_VERSION_H */
diff --git a/libnm/libnm.ver b/libnm/libnm.ver
index ce266bec60..eafd5319eb 100644
--- a/libnm/libnm.ver
+++ b/libnm/libnm.ver
@@ -1665,6 +1665,10 @@ global:
libnm_1_24_0 {
global:
+ nm_client_dbus_call;
+ nm_client_dbus_call_finish;
+ nm_client_dbus_set_property;
+ nm_client_dbus_set_property_finish;
nm_client_get_instance_flags;
nm_client_get_object_by_path;
nm_client_get_permissions_state;
diff --git a/libnm/nm-access-point.c b/libnm/nm-access-point.c
index 77ba65274c..6b49f4581e 100644
--- a/libnm/nm-access-point.c
+++ b/libnm/nm-access-point.c
@@ -573,7 +573,7 @@ nm_access_point_class_init (NMAccessPointClass *ap_class)
*
* Alias for #NMAccessPoint:bssid.
*
- * Deprecated: 1.0: use #NMAccessPoint:bssid.
+ * Deprecated: 1.0: Use #NMAccessPoint:bssid.
**/
obj_properties[PROP_HW_ADDRESS] =
g_param_spec_string (NM_ACCESS_POINT_HW_ADDRESS, "", "",
diff --git a/libnm/nm-client.c b/libnm/nm-client.c
index 76479359cc..68a1836dc8 100644
--- a/libnm/nm-client.c
+++ b/libnm/nm-client.c
@@ -4039,15 +4039,14 @@ nm_client_networking_get_enabled (NMClient *client)
*
* Returns: %TRUE on success, %FALSE otherwise
*
- * Deprecated: 1.22, use nm_client_networking_set_enabled_async() or GDBusConnection
+ * Deprecated: 1.22: Use the async command nm_client_dbus_call() on %NM_DBUS_PATH,
+ * %NM_DBUS_INTERFACE to call "Enable" with "(b)" arguments and no return value.
**/
gboolean
nm_client_networking_set_enabled (NMClient *client, gboolean enable, GError **error)
{
g_return_val_if_fail (NM_IS_CLIENT (client), FALSE);
- /* FIXME(libnm-async-api): add nm_client_networking_set_enabled_async(). */
-
return _nm_client_dbus_call_sync_void (client,
NULL,
NM_DBUS_PATH,
@@ -4083,15 +4082,14 @@ nm_client_wireless_get_enabled (NMClient *client)
*
* Enables or disables wireless devices.
*
- * Deprecated: 1.22, use nm_client_wireless_set_enabled_async() or GDBusConnection
+ * Deprecated: 1.22: Use the async command nm_client_dbus_set_property() on %NM_DBUS_PATH,
+ * %NM_DBUS_INTERFACE to set "WirelessEnabled" property to a "(b)" value.
*/
void
nm_client_wireless_set_enabled (NMClient *client, gboolean enabled)
{
g_return_if_fail (NM_IS_CLIENT (client));
- /* FIXME(libnm-async-api): add nm_client_wireless_set_enabled_async(). */
-
_nm_client_set_property_sync_legacy (client,
NM_DBUS_PATH,
NM_DBUS_INTERFACE,
@@ -4138,14 +4136,15 @@ nm_client_wwan_get_enabled (NMClient *client)
* @enabled: %TRUE to enable WWAN
*
* Enables or disables WWAN devices.
+ *
+ * Deprecated: 1.22: Use the async command nm_client_dbus_set_property() on %NM_DBUS_PATH,
+ * %NM_DBUS_INTERFACE to set "WwanEnabled" property to a "(b)" value.
**/
void
nm_client_wwan_set_enabled (NMClient *client, gboolean enabled)
{
g_return_if_fail (NM_IS_CLIENT (client));
- /* FIXME(libnm-async-api): add nm_client_wwan_set_enabled_async(). */
-
_nm_client_set_property_sync_legacy (client,
NM_DBUS_PATH,
NM_DBUS_INTERFACE,
@@ -4178,7 +4177,7 @@ nm_client_wwan_hardware_get_enabled (NMClient *client)
*
* Returns: %TRUE if WiMAX is enabled
*
- * Deprecated: 1.22 This function always returns FALSE because WiMax is no longer supported
+ * Deprecated: 1.22: This function always returns FALSE because WiMax is no longer supported.
**/
gboolean
nm_client_wimax_get_enabled (NMClient *client)
@@ -4195,7 +4194,7 @@ nm_client_wimax_get_enabled (NMClient *client)
*
* Enables or disables WiMAX devices.
*
- * Deprecated: 1.22 This function does nothing because WiMax is no longer supported
+ * Deprecated: 1.22: This function does nothing because WiMax is no longer supported.
**/
void
nm_client_wimax_set_enabled (NMClient *client, gboolean enabled)
@@ -4211,7 +4210,7 @@ nm_client_wimax_set_enabled (NMClient *client, gboolean enabled)
*
* Returns: %TRUE if the WiMAX hardware is enabled
*
- * Deprecated: 1.22 This function always returns FALSE because WiMax is no longer supported
+ * Deprecated: 1.22: This function always returns FALSE because WiMax is no longer supported.
**/
gboolean
nm_client_wimax_hardware_get_enabled (NMClient *client)
@@ -4269,14 +4268,15 @@ nm_client_connectivity_check_get_enabled (NMClient *client)
* have any effect.
*
* Since: 1.10
+ *
+ * Deprecated: 1.22: Use the async command nm_client_dbus_set_property() on %NM_DBUS_PATH,
+ * %NM_DBUS_INTERFACE to set "ConnectivityCheckEnabled" property to a "(b)" value.
*/
void
nm_client_connectivity_check_set_enabled (NMClient *client, gboolean enabled)
{
g_return_if_fail (NM_IS_CLIENT (client));
- /* FIXME(libnm-async-api): add nm_client_wireless_set_enabled_async(). */
-
_nm_client_set_property_sync_legacy (client,
NM_DBUS_PATH,
NM_DBUS_INTERFACE,
@@ -4316,7 +4316,9 @@ nm_client_connectivity_check_get_uri (NMClient *client)
*
* Returns: %TRUE on success, %FALSE otherwise
*
- * Deprecated: 1.22, use nm_client_get_logging_async() or GDBusConnection
+ * Deprecated: 1.22: Use the async command nm_client_dbus_call() on %NM_DBUS_PATH,
+ * %NM_DBUS_INTERFACE to call "GetLogging" with no arguments to get "(ss)" for level
+ * and domains.
**/
gboolean
nm_client_get_logging (NMClient *client,
@@ -4331,8 +4333,6 @@ nm_client_get_logging (NMClient *client,
g_return_val_if_fail (domains == NULL || *domains == NULL, FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
- /* FIXME(libnm-async-api): add nm_client_get_logging_async(). */
-
ret = _nm_client_dbus_call_sync (client,
NULL,
NM_DBUS_PATH,
@@ -4366,7 +4366,8 @@ nm_client_get_logging (NMClient *client,
*
* Returns: %TRUE on success, %FALSE otherwise
*
- * Deprecated: 1.22, use nm_client_set_logging_async() or GDBusConnection
+ * Deprecated: 1.22: Use the async command nm_client_dbus_call() on %NM_DBUS_PATH,
+ * %NM_DBUS_INTERFACE to call "SetLogging" with "(ss)" arguments for level and domains.
**/
gboolean
nm_client_set_logging (NMClient *client, const char *level, const char *domains, GError **error)
@@ -4374,8 +4375,6 @@ nm_client_set_logging (NMClient *client, const char *level, const char *domains,
g_return_val_if_fail (NM_IS_CLIENT (client), FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
- /* FIXME(libnm-async-api): add nm_client_set_logging_async(). */
-
return _nm_client_dbus_call_sync_void (client,
NULL,
NM_DBUS_PATH,
@@ -4473,7 +4472,7 @@ nm_client_get_connectivity (NMClient *client)
*
* Returns: the (new) current connectivity state
*
- * Deprecated: 1.22, use nm_client_check_connectivity_async() or GDBusConnection
+ * Deprecated: 1.22: Use nm_client_check_connectivity_async() or GDBusConnection.
*/
NMConnectivityState
nm_client_check_connectivity (NMClient *client,
@@ -4602,7 +4601,7 @@ nm_client_check_connectivity_finish (NMClient *client,
*
* Returns: %TRUE if the request was successful, %FALSE if it failed
*
- * Deprecated: 1.22, use nm_client_save_hostname_async() or GDBusConnection
+ * Deprecated: 1.22: Use nm_client_save_hostname_async() or GDBusConnection.
**/
gboolean
nm_client_save_hostname (NMClient *client,
@@ -5312,7 +5311,7 @@ nm_client_add_and_activate_connection2_finish (NMClient *client,
*
* Returns: success or failure
*
- * Deprecated: 1.22, use nm_client_deactivate_connection_async() or GDBusConnection
+ * Deprecated: 1.22: Use nm_client_deactivate_connection_async() or GDBusConnection.
**/
gboolean
nm_client_deactivate_connection (NMClient *client,
@@ -5817,7 +5816,7 @@ nm_client_add_connection2_finish (NMClient *client,
* set. Note that even in the success case, you might have individual @failures.
* With 1.22, the return value is consistent with nm_client_load_connections_finish().
*
- * Deprecated: 1.22, use nm_client_load_connections_async() or GDBusConnection
+ * Deprecated: 1.22: Use nm_client_load_connections_async() or GDBusConnection.
**/
gboolean
nm_client_load_connections (NMClient *client,
@@ -5948,7 +5947,7 @@ nm_client_load_connections_finish (NMClient *client,
*
* Return value: %TRUE on success, %FALSE on failure
*
- * Deprecated: 1.22, use nm_client_reload_connections_async() or GDBusConnection
+ * Deprecated: 1.22: Use nm_client_reload_connections_async() or GDBusConnection.
**/
gboolean
nm_client_reload_connections (NMClient *client,
@@ -6649,6 +6648,174 @@ nm_client_reload_finish (NMClient *client,
/*****************************************************************************/
+/**
+ * nm_client_dbus_call:
+ * @client: the #NMClient
+ * @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: (nullable): a #GVariant tuple with parameters for the method
+ * or %NULL if not passing parameters
+ * @reply_type: (nullable): the expected type of the reply (which will be a
+ * tuple), or %NULL
+ * @timeout_msec: the timeout in milliseconds, -1 to use the default
+ * timeout or %G_MAXINT for no timeout
+ * @cancellable: (nullable): a #GCancellable or %NULL
+ * @callback: (nullable): a #GAsyncReadyCallback to call when the request
+ * is satisfied or %NULL if you don't care about the result of the
+ * method invocation
+ * @user_data: the data to pass to @callback
+ *
+ * Call g_dbus_connection_call() on the current name owner with the specified
+ * arguments. Most importantly, this invokes g_dbus_connection_call() with the
+ * client's #GMainContext, so that the response is always in order with other
+ * events D-Bus events. Of course, the call uses #GTask and will invoke the
+ * callback on the current g_main_context_get_thread_default().
+ *
+ * This API is merely a convenient wrapper for g_dbus_connection_call(). You can
+ * also use g_dbus_connection_call() directly, with the same effect.
+ *
+ * Since: 1.24
+ **/
+void
+nm_client_dbus_call (NMClient *client,
+ const char *object_path,
+ const char *interface_name,
+ const char *method_name,
+ GVariant *parameters,
+ const GVariantType *reply_type,
+ int timeout_msec,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_return_if_fail (NM_IS_CLIENT (client));
+
+ _nm_client_dbus_call (client,
+ client,
+ nm_client_dbus_call,
+ cancellable,
+ callback,
+ user_data,
+ object_path,
+ interface_name,
+ method_name,
+ parameters,
+ reply_type,
+ G_DBUS_CALL_FLAGS_NONE,
+ timeout_msec == -1
+ ? NM_DBUS_DEFAULT_TIMEOUT_MSEC
+ : timeout_msec,
+ nm_dbus_connection_call_finish_variant_cb);
+}
+
+/**
+ * nm_client_dbus_call_finish:
+ * @client: the #NMClient instance
+ * @result: the result passed to the #GAsyncReadyCallback
+ * @error: location for a #GError, or %NULL
+ *
+ * Gets the result of a call to nm_client_dbus_call().
+ *
+ * Returns: (transfer full): the result #GVariant or %NULL on error.
+ *
+ * Since: 1.24
+ **/
+GVariant *
+nm_client_dbus_call_finish (NMClient *client,
+ GAsyncResult *result,
+ GError **error)
+{
+ g_return_val_if_fail (NM_IS_CLIENT (client), FALSE);
+ g_return_val_if_fail (nm_g_task_is_valid (result, client, nm_client_dbus_call), FALSE);
+
+ return g_task_propagate_pointer (G_TASK (result), error);
+}
+
+/*****************************************************************************/
+
+/**
+ * nm_client_dbus_set_property:
+ * @client: the #NMClient
+ * @object_path: path of remote object
+ * @interface_name: D-Bus interface to invoke method on
+ * @property_name: the name of the property to set
+ * @value: a #GVariant tuple with the value to set
+ * @timeout_msec: the timeout in milliseconds, -1 to use the default
+ * timeout or %G_MAXINT for no timeout
+ * @cancellable: (nullable): a #GCancellable or %NULL
+ * @callback: (nullable): a #GAsyncReadyCallback to call when the request
+ * is satisfied or %NULL if you don't care about the result of the
+ * method invocation
+ * @user_data: the data to pass to @callback
+ *
+ * Like nm_client_dbus_call() but calls "Set" on the standard "org.freedesktop.DBus.Properties"
+ * D-Bus interface.
+ *
+ * Since: 1.24
+ **/
+void
+nm_client_dbus_set_property (NMClient *client,
+ const char *object_path,
+ const char *interface_name,
+ const char *property_name,
+ GVariant *value,
+ int timeout_msec,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_return_if_fail (NM_IS_CLIENT (client));
+ g_return_if_fail (interface_name);
+ g_return_if_fail (property_name);
+ g_return_if_fail (value);
+
+ _nm_client_dbus_call (client,
+ client,
+ nm_client_dbus_set_property,
+ cancellable,
+ callback,
+ user_data,
+ object_path,
+ DBUS_INTERFACE_PROPERTIES,
+ "Set",
+ g_variant_new ("(ssv)",
+ interface_name,
+ property_name,
+ value),
+ G_VARIANT_TYPE ("()"),
+ G_DBUS_CALL_FLAGS_NONE,
+ timeout_msec == -1
+ ? NM_DBUS_DEFAULT_TIMEOUT_MSEC
+ : timeout_msec,
+ nm_dbus_connection_call_finish_void_cb);
+}
+
+/**
+ * nm_client_dbus_set_property_finish:
+ * @client: the #NMClient instance
+ * @result: the result passed to the #GAsyncReadyCallback
+ * @error: location for a #GError, or %NULL
+ *
+ * Gets the result of a call to nm_client_dbus_set_property().
+ *
+ * Returns: %TRUE on success or %FALSE on failure.
+ *
+ * Since: 1.24
+ **/
+gboolean
+nm_client_dbus_set_property_finish (NMClient *client,
+ GAsyncResult *result,
+ GError **error)
+{
+ g_return_val_if_fail (NM_IS_CLIENT (client), FALSE);
+ g_return_val_if_fail (nm_g_task_is_valid (result, client, nm_client_dbus_set_property), FALSE);
+
+ return g_task_propagate_boolean (G_TASK (result), error);
+}
+
+/*****************************************************************************/
+
static void
_init_fetch_all (NMClient *self)
{
diff --git a/libnm/nm-client.h b/libnm/nm-client.h
index 9c2fdff9f1..627b228fdd 100644
--- a/libnm/nm-client.h
+++ b/libnm/nm-client.h
@@ -478,6 +478,41 @@ gboolean nm_client_reload_finish (NMClient *client,
GAsyncResult *result,
GError **error);
+/*****************************************************************************/
+
+NM_AVAILABLE_IN_1_24
+void nm_client_dbus_call (NMClient *client,
+ const char *object_path,
+ const char *interface_name,
+ const char *method_name,
+ GVariant *parameters,
+ const GVariantType *reply_type,
+ int timeout_msec,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+NM_AVAILABLE_IN_1_24
+GVariant *nm_client_dbus_call_finish (NMClient *client,
+ GAsyncResult *result,
+ GError **error);
+
+NM_AVAILABLE_IN_1_24
+void nm_client_dbus_set_property (NMClient *client,
+ const char *object_path,
+ const char *interface_name,
+ const char *property_name,
+ GVariant *value,
+ int timeout_msec,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+NM_AVAILABLE_IN_1_24
+gboolean nm_client_dbus_set_property_finish (NMClient *client,
+ GAsyncResult *result,
+ GError **error);
+
G_END_DECLS
#endif /* __NM_CLIENT_H__ */
diff --git a/libnm/nm-device-6lowpan.c b/libnm/nm-device-6lowpan.c
index 5173b6ad12..0b428c2d8b 100644
--- a/libnm/nm-device-6lowpan.c
+++ b/libnm/nm-device-6lowpan.c
@@ -61,7 +61,7 @@ nm_device_6lowpan_get_parent (NMDevice6Lowpan *device)
*
* Since: 1.14
*
- * Deprecated: 1.24 use nm_device_get_hw_address() instead.
+ * Deprecated: 1.24: Use nm_device_get_hw_address() instead.
**/
const char *
nm_device_6lowpan_get_hw_address (NMDevice6Lowpan *device)
diff --git a/libnm/nm-device-bond.c b/libnm/nm-device-bond.c
index 72203247bc..cb236af931 100644
--- a/libnm/nm-device-bond.c
+++ b/libnm/nm-device-bond.c
@@ -50,7 +50,7 @@ G_DEFINE_TYPE (NMDeviceBond, nm_device_bond, NM_TYPE_DEVICE)
* Returns: the hardware address. This is the internal string used by the
* device, and must not be modified.
*
- * Deprecated: 1.24 use nm_device_get_hw_address() instead.
+ * Deprecated: 1.24: Use nm_device_get_hw_address() instead.
**/
const char *
nm_device_bond_get_hw_address (NMDeviceBond *device)
diff --git a/libnm/nm-device-bridge.c b/libnm/nm-device-bridge.c
index bee8c17736..977db1464e 100644
--- a/libnm/nm-device-bridge.c
+++ b/libnm/nm-device-bridge.c
@@ -49,7 +49,7 @@ G_DEFINE_TYPE (NMDeviceBridge, nm_device_bridge, NM_TYPE_DEVICE)
* Returns: the hardware address. This is the internal string used by the
* device, and must not be modified.
*
- * Deprecated: 1.24 use nm_device_get_hw_address() instead.
+ * Deprecated: 1.24: Use nm_device_get_hw_address() instead.
**/
const char *
nm_device_bridge_get_hw_address (NMDeviceBridge *device)
diff --git a/libnm/nm-device-bt.c b/libnm/nm-device-bt.c
index bf7535945c..8df952655b 100644
--- a/libnm/nm-device-bt.c
+++ b/libnm/nm-device-bt.c
@@ -50,7 +50,7 @@ G_DEFINE_TYPE (NMDeviceBt, nm_device_bt, NM_TYPE_DEVICE)
* Returns: the hardware address. This is the internal string used by the
* device, and must not be modified.
*
- * Deprecated: 1.24 use nm_device_get_hw_address() instead.
+ * Deprecated: 1.24: Use nm_device_get_hw_address() instead.
**/
const char *
nm_device_bt_get_hw_address (NMDeviceBt *device)
diff --git a/libnm/nm-device-dummy.c b/libnm/nm-device-dummy.c
index a63cbe941b..3bf8e09f4a 100644
--- a/libnm/nm-device-dummy.c
+++ b/libnm/nm-device-dummy.c
@@ -38,7 +38,7 @@ G_DEFINE_TYPE (NMDeviceDummy, nm_device_dummy, NM_TYPE_DEVICE)
*
* Since: 1.10
*
- * Deprecated: 1.24 use nm_device_get_hw_address() instead.
+ * Deprecated: 1.24: Use nm_device_get_hw_address() instead.
**/
const char *
nm_device_dummy_get_hw_address (NMDeviceDummy *device)
diff --git a/libnm/nm-device-ethernet.c b/libnm/nm-device-ethernet.c
index 20809ee495..b2da28e8cb 100644
--- a/libnm/nm-device-ethernet.c
+++ b/libnm/nm-device-ethernet.c
@@ -54,7 +54,7 @@ G_DEFINE_TYPE (NMDeviceEthernet, nm_device_ethernet, NM_TYPE_DEVICE)
* Returns: the active hardware address. This is the internal string used by the
* device, and must not be modified.
*
- * Deprecated: 1.24 use nm_device_get_hw_address() instead.
+ * Deprecated: 1.24: Use nm_device_get_hw_address() instead.
**/
const char *
nm_device_ethernet_get_hw_address (NMDeviceEthernet *device)
diff --git a/libnm/nm-device-generic.c b/libnm/nm-device-generic.c
index 14d6a5d7c3..3751cb5147 100644
--- a/libnm/nm-device-generic.c
+++ b/libnm/nm-device-generic.c
@@ -45,7 +45,7 @@ G_DEFINE_TYPE (NMDeviceGeneric, nm_device_generic, NM_TYPE_DEVICE)
* Returns: the hardware address. This is the internal string used by the
* device, and must not be modified.
*
- * Deprecated: 1.24 use nm_device_get_hw_address() instead.
+ * Deprecated: 1.24: Use nm_device_get_hw_address() instead.
**/
const char *
nm_device_generic_get_hw_address (NMDeviceGeneric *device)
diff --git a/libnm/nm-device-infiniband.c b/libnm/nm-device-infiniband.c
index 096dc5e12f..ad47c2ed4c 100644
--- a/libnm/nm-device-infiniband.c
+++ b/libnm/nm-device-infiniband.c
@@ -46,7 +46,7 @@ G_DEFINE_TYPE (NMDeviceInfiniband, nm_device_infiniband, NM_TYPE_DEVICE)
* Returns: the hardware address. This is the internal string used by the
* device, and must not be modified.
*
- * Deprecated: 1.24 use nm_device_get_hw_address() instead.
+ * Deprecated: 1.24: Use nm_device_get_hw_address() instead.
**/
const char *
nm_device_infiniband_get_hw_address (NMDeviceInfiniband *device)
diff --git a/libnm/nm-device-macsec.c b/libnm/nm-device-macsec.c
index 36ee110e13..d8352f9c09 100644
--- a/libnm/nm-device-macsec.c
+++ b/libnm/nm-device-macsec.c
@@ -87,7 +87,7 @@ nm_device_macsec_get_parent (NMDeviceMacsec *device)
*
* Since: 1.6
*
- * Deprecated: 1.24 use nm_device_get_hw_address() instead.
+ * Deprecated: 1.24: Use nm_device_get_hw_address() instead.
**/
const char *
nm_device_macsec_get_hw_address (NMDeviceMacsec *device)
diff --git a/libnm/nm-device-macvlan.c b/libnm/nm-device-macvlan.c
index 488e55f944..83dc0e25b8 100644
--- a/libnm/nm-device-macvlan.c
+++ b/libnm/nm-device-macvlan.c
@@ -128,7 +128,7 @@ nm_device_macvlan_get_tap (NMDeviceMacvlan *device)
*
* This property is not implemented yet, and the function always return NULL.
*
- * Deprecated: 1.24 use nm_device_get_hw_address() instead.
+ * Deprecated: 1.24: Use nm_device_get_hw_address() instead.
**/
const char *
nm_device_macvlan_get_hw_address (NMDeviceMacvlan *device)
diff --git a/libnm/nm-device-olpc-mesh.c b/libnm/nm-device-olpc-mesh.c
index f2d9ea67c8..d6fa03f19e 100644
--- a/libnm/nm-device-olpc-mesh.c
+++ b/libnm/nm-device-olpc-mesh.c
@@ -48,7 +48,7 @@ G_DEFINE_TYPE (NMDeviceOlpcMesh, nm_device_olpc_mesh, NM_TYPE_DEVICE)
* Returns: the hardware address. This is the internal string used by the
* device, and must not be modified.
*
- * Deprecated: 1.24 use nm_device_get_hw_address() instead.
+ * Deprecated: 1.24: Use nm_device_get_hw_address() instead.
**/
const char *
nm_device_olpc_mesh_get_hw_address (NMDeviceOlpcMesh *device)
diff --git a/libnm/nm-device-team.c b/libnm/nm-device-team.c
index 4c12f1e4ce..5e97a7df83 100644
--- a/libnm/nm-device-team.c
+++ b/libnm/nm-device-team.c
@@ -51,7 +51,7 @@ G_DEFINE_TYPE (NMDeviceTeam, nm_device_team, NM_TYPE_DEVICE)
* Returns: the hardware address. This is the internal string used by the
* device, and must not be modified.
*
- * Deprecated: 1.24 use nm_device_get_hw_address() instead.
+ * Deprecated: 1.24: Use nm_device_get_hw_address() instead.
**/
const char *
nm_device_team_get_hw_address (NMDeviceTeam *device)
diff --git a/libnm/nm-device-tun.c b/libnm/nm-device-tun.c
index 79b8971320..26e4a318ad 100644
--- a/libnm/nm-device-tun.c
+++ b/libnm/nm-device-tun.c
@@ -60,7 +60,7 @@ G_DEFINE_TYPE (NMDeviceTun, nm_device_tun, NM_TYPE_DEVICE)
*
* Since: 1.2
*
- * Deprecated: 1.24 use nm_device_get_hw_address() instead.
+ * Deprecated: 1.24: Use nm_device_get_hw_address() instead.
**/
const char *
nm_device_tun_get_hw_address (NMDeviceTun *device)
diff --git a/libnm/nm-device-vlan.c b/libnm/nm-device-vlan.c
index f1ed8f195a..fdc2193696 100644
--- a/libnm/nm-device-vlan.c
+++ b/libnm/nm-device-vlan.c
@@ -51,7 +51,7 @@ G_DEFINE_TYPE (NMDeviceVlan, nm_device_vlan, NM_TYPE_DEVICE)
* Returns: the hardware address. This is the internal string used by the
* device, and must not be modified.
*
- * Deprecated: 1.24 use nm_device_get_hw_address() instead.
+ * Deprecated: 1.24: Use nm_device_get_hw_address() instead.
**/
const char *
nm_device_vlan_get_hw_address (NMDeviceVlan *device)
diff --git a/libnm/nm-device-vxlan.c b/libnm/nm-device-vxlan.c
index 38fc23dd6c..c048a980ce 100644
--- a/libnm/nm-device-vxlan.c
+++ b/libnm/nm-device-vxlan.c
@@ -79,7 +79,7 @@ G_DEFINE_TYPE (NMDeviceVxlan, nm_device_vxlan, NM_TYPE_DEVICE)
*
* Since: 1.2
*
- * Deprecated: 1.24 use nm_device_get_hw_address() instead.
+ * Deprecated: 1.24: Use nm_device_get_hw_address() instead.
**/
const char *
nm_device_vxlan_get_hw_address (NMDeviceVxlan *device)
diff --git a/libnm/nm-device-wifi-p2p.c b/libnm/nm-device-wifi-p2p.c
index a630fcb952..972983d16e 100644
--- a/libnm/nm-device-wifi-p2p.c
+++ b/libnm/nm-device-wifi-p2p.c
@@ -61,7 +61,7 @@ G_DEFINE_TYPE (NMDeviceWifiP2P, nm_device_wifi_p2p, NM_TYPE_DEVICE)
*
* Since: 1.16
*
- * Deprecated: 1.24 use nm_device_get_hw_address() instead.
+ * Deprecated: 1.24: Use nm_device_get_hw_address() instead.
**/
const char *
nm_device_wifi_p2p_get_hw_address (NMDeviceWifiP2P *device)
diff --git a/libnm/nm-device-wifi.c b/libnm/nm-device-wifi.c
index aef2d54661..5c12b67620 100644
--- a/libnm/nm-device-wifi.c
+++ b/libnm/nm-device-wifi.c
@@ -73,7 +73,7 @@ G_DEFINE_TYPE (NMDeviceWifi, nm_device_wifi, NM_TYPE_DEVICE)
* Returns: the actual hardware address. This is the internal string used by the
* device, and must not be modified.
*
- * Deprecated: 1.24 use nm_device_get_hw_address() instead.
+ * Deprecated: 1.24: Use nm_device_get_hw_address() instead.
**/
const char *
nm_device_wifi_get_hw_address (NMDeviceWifi *device)
@@ -266,7 +266,7 @@ nm_device_wifi_get_last_scan (NMDeviceWifi *device)
* Returns: %TRUE on success, %FALSE on error, in which case @error will be
* set.
*
- * Deprecated: 1.22, use nm_device_wifi_request_scan_async() or GDBusConnection
+ * Deprecated: 1.22: Use nm_device_wifi_request_scan_async() or GDBusConnection.
**/
gboolean
nm_device_wifi_request_scan (NMDeviceWifi *device,
@@ -296,7 +296,7 @@ nm_device_wifi_request_scan (NMDeviceWifi *device,
*
* Since: 1.2
*
- * Deprecated: 1.22, use nm_device_wifi_request_scan_options_async() or GDBusConnection
+ * Deprecated: 1.22: Use nm_device_wifi_request_scan_options_async() or GDBusConnection.
**/
gboolean
nm_device_wifi_request_scan_options (NMDeviceWifi *device,
diff --git a/libnm/nm-device-wimax.h b/libnm/nm-device-wimax.h
index 10d2cd18e3..8956715e91 100644
--- a/libnm/nm-device-wimax.h
+++ b/libnm/nm-device-wimax.h
@@ -34,7 +34,7 @@ G_BEGIN_DECLS
/**
* NMDeviceWimax:
*
- * Deprecated: 1.22. WiMAX is no longer supported by NetworkManager since 1.2.0
+ * Deprecated: 1.22: WiMAX is no longer supported by NetworkManager since 1.2.0.
*/
typedef struct _NMDeviceWimaxClass NMDeviceWimaxClass;
diff --git a/libnm/nm-device-wpan.c b/libnm/nm-device-wpan.c
index 2b7f0566d7..9cbf4ae042 100644
--- a/libnm/nm-device-wpan.c
+++ b/libnm/nm-device-wpan.c
@@ -33,7 +33,7 @@ G_DEFINE_TYPE (NMDeviceWpan, nm_device_wpan, NM_TYPE_DEVICE)
* Returns: the active hardware address. This is the internal string used by the
* device, and must not be modified.
*
- * Deprecated: 1.24 use nm_device_get_hw_address() instead.
+ * Deprecated: 1.24: Use nm_device_get_hw_address() instead.
**/
const char *
nm_device_wpan_get_hw_address (NMDeviceWpan *device)
diff --git a/libnm/nm-device.c b/libnm/nm-device.c
index 96b288f008..5dc40d2c4b 100644
--- a/libnm/nm-device.c
+++ b/libnm/nm-device.c
@@ -1211,8 +1211,9 @@ nm_device_get_managed (NMDevice *device)
*
* Since: 1.2
*
- * Deprecated: 1.22, use nm_device_set_managed_async() or GDBusConnection
- *
+ * Deprecated: 1.22: Use the async command nm_client_dbus_set_property() on
+ * nm_object_get_path(), interface %NM_DBUS_INTERFACE_DEVICE to set the
+ * "Managed" property to a "(b)" boolean value.
* This function is deprecated because it calls a synchronous D-Bus method
* and modifies the content of the NMClient cache client side. Also, it does
* not emit a property changed signal.
@@ -1222,8 +1223,6 @@ nm_device_set_managed (NMDevice *device, gboolean managed)
{
g_return_if_fail (NM_IS_DEVICE (device));
- /* FIXME(libnm-async-api): add nm_device_set_managed_async(). */
-
managed = !!managed;
NM_DEVICE_GET_PRIVATE (device)->managed = managed;
@@ -1259,8 +1258,8 @@ nm_device_get_autoconnect (NMDevice *device)
*
* Enables or disables automatic activation of the #NMDevice.
*
- * Deprecated: 1.22, use nm_device_set_autoconnect_async() or GDBusConnection
- *
+ * Deprecated: 1.22: Use the async command nm_client_dbus_set_property() on
+ * nm_object_get_path(), %NM_DBUS_INTERFACE_DEVICE to set "AutoConnect" property to a "(b)" value.
* This function is deprecated because it calls a synchronous D-Bus method
* and modifies the content of the NMClient cache client side.
**/
@@ -1269,8 +1268,6 @@ nm_device_set_autoconnect (NMDevice *device, gboolean autoconnect)
{
g_return_if_fail (NM_IS_DEVICE (device));
- /* FIXME(libnm-async-api): add nm_device_set_autoconnect_async(). */
-
NM_DEVICE_GET_PRIVATE (device)->autoconnect = autoconnect;
_nm_client_set_property_sync_legacy (_nm_object_get_client (device),
@@ -2149,7 +2146,7 @@ nm_device_is_software (NMDevice *device)
*
* Since: 1.2
*
- * Deprecated: 1.22, use nm_device_reapply_async() or GDBusConnection
+ * Deprecated: 1.22: Use nm_device_reapply_async() or GDBusConnection.
**/
gboolean
nm_device_reapply (NMDevice *device,
@@ -2289,7 +2286,7 @@ nm_device_reapply_finish (NMDevice *device,
*
* Since: 1.2
*
- * Deprecated: 1.22, use nm_device_get_applied_connection_async() or GDBusConnection
+ * Deprecated: 1.22: Use nm_device_get_applied_connection_async() or GDBusConnection.
**/
NMConnection *
nm_device_get_applied_connection (NMDevice *device,
@@ -2436,7 +2433,7 @@ nm_device_get_applied_connection_finish (NMDevice *device,
*
* Returns: %TRUE on success, %FALSE on error, in which case @error will be set.
*
- * Deprecated: 1.22, use nm_device_disconnect_async() or GDBusConnection
+ * Deprecated: 1.22: Use nm_device_disconnect_async() or GDBusConnection.
**/
gboolean
nm_device_disconnect (NMDevice *device,
@@ -2528,7 +2525,7 @@ nm_device_disconnect_finish (NMDevice *device,
* Returns: %TRUE on success, %FALSE on error, in which case @error
* will be set.
*
- * Deprecated: 1.22, use nm_device_delete_async() or GDBusConnection
+ * Deprecated: 1.22: Use nm_device_delete_async() or GDBusConnection.
**/
gboolean
nm_device_delete (NMDevice *device,
diff --git a/libnm/nm-libnm-utils.h b/libnm/nm-libnm-utils.h
index e1506b0497..64ce81ad3b 100644
--- a/libnm/nm-libnm-utils.h
+++ b/libnm/nm-libnm-utils.h
@@ -15,12 +15,6 @@
/*****************************************************************************/
-/* Markers for deprecated sync code in internal API. */
-#define _NM_DEPRECATED_SYNC_METHOD_INTERNAL NM_DEPRECATED_IN_1_22
-#define _NM_DEPRECATED_SYNC_WRITABLE_PROPERTY_INTERNAL NM_DEPRECATED_IN_1_22
-
-/*****************************************************************************/
-
char *nm_utils_fixup_vendor_string (const char *desc);
char *nm_utils_fixup_product_string (const char *desc);
diff --git a/libnm/nm-remote-connection.c b/libnm/nm-remote-connection.c
index d1cc90d613..b37f58148b 100644
--- a/libnm/nm-remote-connection.c
+++ b/libnm/nm-remote-connection.c
@@ -164,7 +164,7 @@ nm_remote_connection_update2_finish (NMRemoteConnection *connection,
*
* Returns: %TRUE on success, %FALSE on error, in which case @error will be set.
*
- * Deprecated: 1.22, use nm_remote_connection_commit_changes_async() or GDBusConnection
+ * Deprecated: 1.22: Use nm_remote_connection_commit_changes_async() or GDBusConnection.
**/
gboolean
nm_remote_connection_commit_changes (NMRemoteConnection *connection,
@@ -269,7 +269,7 @@ nm_remote_connection_commit_changes_finish (NMRemoteConnection *connection,
*
* Returns: %TRUE on success, %FALSE on error, in which case @error will be set.
*
- * Deprecated: 1.22, use nm_remote_connection_save_async() or GDBusConnection
+ * Deprecated: 1.22: Use nm_remote_connection_save_async() or GDBusConnection.
**/
gboolean
nm_remote_connection_save (NMRemoteConnection *connection,
@@ -359,7 +359,7 @@ nm_remote_connection_save_finish (NMRemoteConnection *connection,
*
* Returns: %TRUE on success, %FALSE on error, in which case @error will be set.
*
- * Deprecated: 1.22, use nm_remote_connection_delete_async() or GDBusConnection
+ * Deprecated: 1.22: Use nm_remote_connection_delete_async() or GDBusConnection.
**/
gboolean
nm_remote_connection_delete (NMRemoteConnection *connection,
@@ -448,7 +448,7 @@ nm_remote_connection_delete_finish (NMRemoteConnection *connection,
* Returns: (transfer full): a #GVariant of type %NM_VARIANT_TYPE_CONNECTION containing
* @connection's secrets, or %NULL on error.
*
- * Deprecated: 1.22, use nm_remote_connection_get_secrets_async() or GDBusConnection
+ * Deprecated: 1.22: Use nm_remote_connection_get_secrets_async() or GDBusConnection.
**/
GVariant *
nm_remote_connection_get_secrets (NMRemoteConnection *connection,
diff --git a/libnm/nm-secret-agent-old.c b/libnm/nm-secret-agent-old.c
index f102ecc752..d614a34c3c 100644
--- a/libnm/nm-secret-agent-old.c
+++ b/libnm/nm-secret-agent-old.c
@@ -732,7 +732,7 @@ nm_secret_agent_old_destroy (NMSecretAgentOld *self)
* Since 1.24, registration is idempotent. It has the same effect as setting
* %NM_SECRET_AGENT_OLD_AUTO_REGISTER to %TRUE or nm_secret_agent_old_enable().
*
- * Deprecated: 1.24: use nm_secret_agent_old_enable() or nm_secret_agent_old_register_async().
+ * Deprecated: 1.24: Use nm_secret_agent_old_enable() or nm_secret_agent_old_register_async().
**/
gboolean
nm_secret_agent_old_register (NMSecretAgentOld *self,
@@ -900,7 +900,7 @@ nm_secret_agent_old_register_finish (NMSecretAgentOld *self,
* the same effect as setting %NM_SECRET_AGENT_OLD_AUTO_REGISTER to %FALSE
* or nm_secret_agent_old_enable().
*
- * Deprecated: 1.24: use nm_secret_agent_old_enable()
+ * Deprecated: 1.24: Use nm_secret_agent_old_enable().
**/
gboolean
nm_secret_agent_old_unregister (NMSecretAgentOld *self,
@@ -938,7 +938,7 @@ nm_secret_agent_old_unregister (NMSecretAgentOld *self,
* the same effect as setting %NM_SECRET_AGENT_OLD_AUTO_REGISTER to %FALSE
* or nm_secret_agent_old_enable().
*
- * Deprecated: 1.24: use nm_secret_agent_old_enable()
+ * Deprecated: 1.24: Use nm_secret_agent_old_enable().
**/
void
nm_secret_agent_old_unregister_async (NMSecretAgentOld *self,
@@ -980,7 +980,7 @@ nm_secret_agent_old_unregister_async (NMSecretAgentOld *self,
* the same effect as setting %NM_SECRET_AGENT_OLD_AUTO_REGISTER to %FALSE
* or nm_secret_agent_old_enable().
*
- * Deprecated: 1.24: use nm_secret_agent_old_enable()
+ * Deprecated: 1.24: Use nm_secret_agent_old_enable().
**/
gboolean
nm_secret_agent_old_unregister_finish (NMSecretAgentOld *self,
diff --git a/libnm/nm-vpn-plugin-old.c b/libnm/nm-vpn-plugin-old.c
index 782fd80dc0..c56a9b5b9f 100644
--- a/libnm/nm-vpn-plugin-old.c
+++ b/libnm/nm-vpn-plugin-old.c
@@ -92,7 +92,7 @@ nm_vpn_plugin_old_set_connection (NMVpnPluginOld *plugin,
*
* Returns: (transfer full):
*
- * Deprecated: 1.2: replaced by NMVpnServicePlugin
+ * Deprecated: 1.2: Replaced by NMVpnServicePlugin.
*/
GDBusConnection *
nm_vpn_plugin_old_get_connection (NMVpnPluginOld *plugin)
@@ -112,7 +112,7 @@ nm_vpn_plugin_old_get_connection (NMVpnPluginOld *plugin)
/**
* nm_vpn_plugin_old_get_state:
*
- * Deprecated: 1.2: replaced by NMVpnServicePlugin
+ * Deprecated: 1.2: Replaced by NMVpnServicePlugin.
*/
NMVpnServiceState
nm_vpn_plugin_old_get_state (NMVpnPluginOld *plugin)
@@ -125,7 +125,7 @@ nm_vpn_plugin_old_get_state (NMVpnPluginOld *plugin)
/**
* nm_vpn_plugin_old_set_state:
*
- * Deprecated: 1.2: replaced by NMVpnServicePlugin
+ * Deprecated: 1.2: Replaced by NMVpnServicePlugin.
*/
void
nm_vpn_plugin_old_set_state (NMVpnPluginOld *plugin,
@@ -145,7 +145,7 @@ nm_vpn_plugin_old_set_state (NMVpnPluginOld *plugin,
/**
* nm_vpn_plugin_old_set_login_banner:
*
- * Deprecated: 1.2: replaced by NMVpnServicePlugin
+ * Deprecated: 1.2: Replaced by NMVpnServicePlugin.
*/
void
nm_vpn_plugin_old_set_login_banner (NMVpnPluginOld *plugin,
@@ -160,7 +160,7 @@ nm_vpn_plugin_old_set_login_banner (NMVpnPluginOld *plugin,
/**
* nm_vpn_plugin_old_failure:
*
- * Deprecated: 1.2: replaced by NMVpnServicePlugin
+ * Deprecated: 1.2: Replaced by NMVpnServicePlugin.
*/
void
nm_vpn_plugin_old_failure (NMVpnPluginOld *plugin,
@@ -174,7 +174,7 @@ nm_vpn_plugin_old_failure (NMVpnPluginOld *plugin,
/**
* nm_vpn_plugin_old_disconnect:
*
- * Deprecated: 1.2: replaced by NMVpnServicePlugin
+ * Deprecated: 1.2: Replaced by NMVpnServicePlugin.
*/
gboolean
nm_vpn_plugin_old_disconnect (NMVpnPluginOld *plugin, GError **err)
@@ -288,7 +288,7 @@ schedule_fail_stop (NMVpnPluginOld *plugin, guint timeout_secs)
/**
* nm_vpn_plugin_old_set_config:
*
- * Deprecated: 1.2: replaced by NMVpnServicePlugin
+ * Deprecated: 1.2: Replaced by NMVpnServicePlugin.
*/
void
nm_vpn_plugin_old_set_config (NMVpnPluginOld *plugin,
@@ -332,7 +332,7 @@ nm_vpn_plugin_old_set_config (NMVpnPluginOld *plugin,
/**
* nm_vpn_plugin_old_set_ip4_config:
*
- * Deprecated: 1.2: replaced by NMVpnServicePlugin
+ * Deprecated: 1.2: Replaced by NMVpnServicePlugin.
*/
void
nm_vpn_plugin_old_set_ip4_config (NMVpnPluginOld *plugin,
@@ -392,7 +392,7 @@ nm_vpn_plugin_old_set_ip4_config (NMVpnPluginOld *plugin,
/**
* nm_vpn_plugin_old_set_ip6_config:
*
- * Deprecated: 1.2: replaced by NMVpnServicePlugin
+ * Deprecated: 1.2: Replaced by NMVpnServicePlugin.
*/
void
nm_vpn_plugin_old_set_ip6_config (NMVpnPluginOld *plugin,
@@ -637,7 +637,7 @@ impl_vpn_plugin_old_new_secrets (NMVpnPluginOld *plugin,
* are insufficient, or the VPN process indicates that it needs additional
* information to complete the request.
*
- * Deprecated: 1.2: replaced by NMVpnServicePlugin
+ * Deprecated: 1.2: Replaced by NMVpnServicePlugin.
*/
void
nm_vpn_plugin_old_secrets_required (NMVpnPluginOld *plugin,
@@ -677,7 +677,7 @@ nm_vpn_plugin_old_secrets_required (NMVpnPluginOld *plugin,
*
* Returns: %TRUE if reading values was successful, %FALSE if not
*
- * Deprecated: 1.2: replaced by NMVpnServicePlugin
+ * Deprecated: 1.2: Replaced by NMVpnServicePlugin.
**/
gboolean
nm_vpn_plugin_old_read_vpn_details (int fd,
@@ -700,7 +700,7 @@ nm_vpn_plugin_old_read_vpn_details (int fd,
* Returns: %TRUE if the flag data item was found and successfully converted
* to flags, %FALSE if not
*
- * Deprecated: 1.2: replaced by NMVpnServicePlugin
+ * Deprecated: 1.2: Replaced by NMVpnServicePlugin.
**/
gboolean
nm_vpn_plugin_old_get_secret_flags (GHashTable *data,
@@ -1012,7 +1012,7 @@ nm_vpn_plugin_old_class_init (NMVpnPluginOldClass *plugin_class)
*
* The D-Bus service name of this plugin.
*
- * Deprecated: 1.2: replaced by NMVpnServicePlugin
+ * Deprecated: 1.2: Replaced by NMVpnServicePlugin.
*/
obj_properties[PROP_DBUS_SERVICE_NAME] =
g_param_spec_string (NM_VPN_PLUGIN_OLD_DBUS_SERVICE_NAME, "", "",
@@ -1026,7 +1026,7 @@ nm_vpn_plugin_old_class_init (NMVpnPluginOldClass *plugin_class)
*
* The state of the plugin.
*
- * Deprecated: 1.2: replaced by NMVpnServicePlugin
+ * Deprecated: 1.2: Replaced by NMVpnServicePlugin.
*/
obj_properties[PROP_STATE] =
g_param_spec_enum (NM_VPN_PLUGIN_OLD_STATE, "", "",
diff --git a/libnm/nm-wimax-nsp.c b/libnm/nm-wimax-nsp.c
index d8472838f8..00ed636c06 100644
--- a/libnm/nm-wimax-nsp.c
+++ b/libnm/nm-wimax-nsp.c
@@ -37,7 +37,7 @@ G_DEFINE_TYPE (NMWimaxNsp, nm_wimax_nsp, NM_TYPE_OBJECT)
*
* Returns: the name
*
- * Deprecated: 1.22. WiMAX is no longer supported by NetworkManager since 1.2.0
+ * Deprecated: 1.22: WiMAX is no longer supported by NetworkManager since 1.2.0.
**/
const char *
nm_wimax_nsp_get_name (NMWimaxNsp *nsp)
@@ -53,7 +53,7 @@ nm_wimax_nsp_get_name (NMWimaxNsp *nsp)
*
* Returns: the signal quality
*
- * Deprecated: 1.22. WiMAX is no longer supported by NetworkManager since 1.2.0
+ * Deprecated: 1.22: WiMAX is no longer supported by NetworkManager since 1.2.0.
**/
guint32
nm_wimax_nsp_get_signal_quality (NMWimaxNsp *nsp)
@@ -69,7 +69,7 @@ nm_wimax_nsp_get_signal_quality (NMWimaxNsp *nsp)
*
* Returns: the network type
*
- * Deprecated: 1.22. WiMAX is no longer supported by NetworkManager since 1.2.0
+ * Deprecated: 1.22: WiMAX is no longer supported by NetworkManager since 1.2.0.
**/
NMWimaxNspNetworkType
nm_wimax_nsp_get_network_type (NMWimaxNsp *nsp)
@@ -89,7 +89,7 @@ nm_wimax_nsp_get_network_type (NMWimaxNsp *nsp)
* Returns: %TRUE if the connection may be activated with this WiMAX NSP,
* %FALSE if it cannot be.
*
- * Deprecated: 1.22. WiMAX is no longer supported by NetworkManager since 1.2.0
+ * Deprecated: 1.22: WiMAX is no longer supported by NetworkManager since 1.2.0.
**/
gboolean
nm_wimax_nsp_connection_valid (NMWimaxNsp *nsp, NMConnection *connection)
@@ -111,7 +111,7 @@ nm_wimax_nsp_connection_valid (NMWimaxNsp *nsp, NMConnection *connection)
* #NMConnections that could be activated with the given @nsp. The array should
* be freed with g_ptr_array_unref() when it is no longer required.
*
- * Deprecated: 1.22. WiMAX is no longer supported by NetworkManager since 1.2.0
+ * Deprecated: 1.22: WiMAX is no longer supported by NetworkManager since 1.2.0.
**/
GPtrArray *
nm_wimax_nsp_filter_connections (NMWimaxNsp *nsp, const GPtrArray *connections)
@@ -148,7 +148,7 @@ nm_wimax_nsp_class_init (NMWimaxNspClass *nsp_class)
*
* The name of the WiMAX NSP.
*
- * Deprecated: 1.22. WiMAX is no longer supported by NetworkManager since 1.2.0
+ * Deprecated: 1.22: WiMAX is no longer supported by NetworkManager since 1.2.0.
**/
obj_properties[PROP_NAME] =
g_param_spec_string (NM_WIMAX_NSP_NAME, "", "",
@@ -161,7 +161,7 @@ nm_wimax_nsp_class_init (NMWimaxNspClass *nsp_class)
*
* The signal quality of the WiMAX NSP.
*
- * Deprecated: 1.22. WiMAX is no longer supported by NetworkManager since 1.2.0
+ * Deprecated: 1.22: WiMAX is no longer supported by NetworkManager since 1.2.0.
**/
obj_properties[PROP_SIGNAL_QUALITY] =
g_param_spec_uint (NM_WIMAX_NSP_SIGNAL_QUALITY, "", "",
@@ -174,7 +174,7 @@ nm_wimax_nsp_class_init (NMWimaxNspClass *nsp_class)
*
* The network type of the WiMAX NSP.
*
- * Deprecated: 1.22. WiMAX is no longer supported by NetworkManager since 1.2.0
+ * Deprecated: 1.22: WiMAX is no longer supported by NetworkManager since 1.2.0.
**/
obj_properties[PROP_NETWORK_TYPE] =
g_param_spec_enum (NM_WIMAX_NSP_NETWORK_TYPE, "", "",
diff --git a/libnm/nm-wimax-nsp.h b/libnm/nm-wimax-nsp.h
index 17a10b7d7a..1fd95821bb 100644
--- a/libnm/nm-wimax-nsp.h
+++ b/libnm/nm-wimax-nsp.h
@@ -29,7 +29,7 @@ G_BEGIN_DECLS
/**
* NMWimaxNsp:
*
- * Deprecated: 1.22. WiMAX is no longer supported by NetworkManager since 1.2.0
+ * Deprecated: 1.22: WiMAX is no longer supported by NetworkManager since 1.2.0.
*/
typedef struct _NMWimaxNspClass NMWimaxNspClass;
diff --git a/shared/nm-glib-aux/nm-dbus-aux.c b/shared/nm-glib-aux/nm-dbus-aux.c
index 9cb0a7f091..54e54ca713 100644
--- a/shared/nm-glib-aux/nm-dbus-aux.c
+++ b/shared/nm-glib-aux/nm-dbus-aux.c
@@ -205,10 +205,9 @@ _call_finish_cb (GObject *source,
return;
}
- if (!return_void) {
- nm_assert (!g_variant_is_of_type (ret, G_VARIANT_TYPE ("()")));
+ if (!return_void)
g_task_return_pointer (task, g_steal_pointer (&ret), (GDestroyNotify) g_variant_unref);
- } else {
+ else {
nm_assert (g_variant_is_of_type (ret, G_VARIANT_TYPE ("()")));
g_task_return_boolean (task, TRUE);
}
@@ -253,7 +252,6 @@ nm_dbus_connection_call_finish_void_strip_dbus_error_cb (GObject *source,
*
* - user_data must be a GTask, whose reference will be consumed by the
* callback.
- * - the return GVariant must not be an empty tuple "()".
* - the GTask is returned either with error or with a pointer containing the GVariant.
*/
void