diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2018-12-13 10:46:58 +0100 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2019-01-03 16:42:18 +0000 |
commit | 55c3026643ee6c75c0a68171abd884edf035b9ba (patch) | |
tree | f1bc2faa1bd0da6c8cec498dbb368a01e3952c0b /libmm-glib/mm-bearer-properties.c | |
parent | 5dc79ce6069a388db8c94a9fbe35cfee07445bb0 (diff) |
api: deprecate 'number' in bearer properties
https://gitlab.freedesktop.org/mobile-broadband/ModemManager/issues/99
Diffstat (limited to 'libmm-glib/mm-bearer-properties.c')
-rw-r--r-- | libmm-glib/mm-bearer-properties.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/libmm-glib/mm-bearer-properties.c b/libmm-glib/mm-bearer-properties.c index a02316d1..dfddeff1 100644 --- a/libmm-glib/mm-bearer-properties.c +++ b/libmm-glib/mm-bearer-properties.c @@ -38,10 +38,12 @@ G_DEFINE_TYPE (MMBearerProperties, mm_bearer_properties, G_TYPE_OBJECT); #define PROPERTY_USER "user" #define PROPERTY_PASSWORD "password" #define PROPERTY_IP_TYPE "ip-type" -#define PROPERTY_NUMBER "number" #define PROPERTY_ALLOW_ROAMING "allow-roaming" #define PROPERTY_RM_PROTOCOL "rm-protocol" +/* no longer used properties */ +#define DEPRECATED_PROPERTY_NUMBER "number" + struct _MMBearerPropertiesPrivate { /* APN */ gchar *apn; @@ -49,8 +51,6 @@ struct _MMBearerPropertiesPrivate { MMBearerIpFamily ip_type; /* Allowed auth */ MMBearerAllowedAuth allowed_auth; - /* Number */ - gchar *number; /* User */ gchar *user; /* Password */ @@ -273,12 +273,17 @@ mm_bearer_properties_get_allow_roaming (MMBearerProperties *self) /*****************************************************************************/ +#ifndef MM_DISABLE_DEPRECATED + /** * mm_bearer_properties_set_number: * @self: a #MMBearerProperties. * @number: the number. * * Sets the number to use when performing the connection. + * + * Deprecated: 1.10.0. The number setting is not used anywhere, and therefore + * it doesn't make sense to expose it in the ModemManager interface. */ void mm_bearer_properties_set_number (MMBearerProperties *self, @@ -286,8 +291,7 @@ mm_bearer_properties_set_number (MMBearerProperties *self, { g_return_if_fail (MM_IS_BEARER_PROPERTIES (self)); - g_free (self->priv->number); - self->priv->number = g_strdup (number); + /* NO-OP */ } /** @@ -297,15 +301,21 @@ mm_bearer_properties_set_number (MMBearerProperties *self, * Gets the number to use when performing the connection. * * Returns: (transfer none): the number, or #NULL if not set. Do not free the returned value, it is owned by @self. + * + * Deprecated: 1.10.0. The number setting is not used anywhere, and therefore + * it doesn't make sense to expose it in the ModemManager interface. */ const gchar * mm_bearer_properties_get_number (MMBearerProperties *self) { g_return_val_if_fail (MM_IS_BEARER_PROPERTIES (self), NULL); - return self->priv->number; + /* NO-OP */ + return NULL; } +#endif /* MM_DISABLE_DEPRECATED */ + /*****************************************************************************/ /** @@ -385,12 +395,6 @@ mm_bearer_properties_get_dictionary (MMBearerProperties *self) PROPERTY_IP_TYPE, g_variant_new_uint32 (self->priv->ip_type)); - if (self->priv->number) - g_variant_builder_add (&builder, - "{sv}", - PROPERTY_NUMBER, - g_variant_new_string (self->priv->number)); - if (self->priv->allow_roaming_set) g_variant_builder_add (&builder, "{sv}", @@ -452,9 +456,7 @@ mm_bearer_properties_consume_string (MMBearerProperties *self, return FALSE; } mm_bearer_properties_set_allow_roaming (self, allow_roaming); - } else if (g_str_equal (key, PROPERTY_NUMBER)) - mm_bearer_properties_set_number (self, value); - else if (g_str_equal (key, PROPERTY_RM_PROTOCOL)) { + } else if (g_str_equal (key, PROPERTY_RM_PROTOCOL)) { GError *inner_error = NULL; MMModemCdmaRmProtocol protocol; @@ -464,6 +466,8 @@ mm_bearer_properties_consume_string (MMBearerProperties *self, return FALSE; } mm_bearer_properties_set_rm_protocol (self, protocol); + } else if (g_str_equal (key, DEPRECATED_PROPERTY_NUMBER)) { + /* NO-OP */ } else { g_set_error (error, MM_CORE_ERROR, @@ -545,15 +549,13 @@ mm_bearer_properties_consume_variant (MMBearerProperties *properties, mm_bearer_properties_set_ip_type ( properties, g_variant_get_uint32 (value)); - else if (g_str_equal (key, PROPERTY_NUMBER)) - mm_bearer_properties_set_number ( - properties, - g_variant_get_string (value, NULL)); else if (g_str_equal (key, PROPERTY_ALLOW_ROAMING)) mm_bearer_properties_set_allow_roaming ( properties, g_variant_get_boolean (value)); - else { + else if (g_str_equal (key, DEPRECATED_PROPERTY_NUMBER)) { + /* NO-OP */ + } else { /* Set error */ g_set_error (error, MM_CORE_ERROR, @@ -646,7 +648,6 @@ mm_bearer_properties_cmp (MMBearerProperties *a, { return ((!g_strcmp0 (a->priv->apn, b->priv->apn)) && (a->priv->ip_type == b->priv->ip_type) && - (!g_strcmp0 (a->priv->number, b->priv->number)) && (a->priv->allowed_auth == b->priv->allowed_auth) && (!g_strcmp0 (a->priv->user, b->priv->user)) && (!g_strcmp0 (a->priv->password, b->priv->password)) && @@ -693,7 +694,6 @@ finalize (GObject *object) g_free (self->priv->apn); g_free (self->priv->user); g_free (self->priv->password); - g_free (self->priv->number); G_OBJECT_CLASS (mm_bearer_properties_parent_class)->finalize (object); } |