diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2013-05-29 10:47:53 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2013-06-05 19:15:14 +0200 |
commit | 212d00c529ee07131bf3b71a8759dca49292c059 (patch) | |
tree | f84e015d4e2b676c865b68e408651623a317dc2e /libmm-glib/mm-simple-connect-properties.c | |
parent | 4dc8d1ff3a88a54707e75859619b020780de2f79 (diff) | |
download | ModemManager-212d00c529ee07131bf3b71a8759dca49292c059.tar.gz |
api,instrospection: rename 'Bands' to 'CurrentBands'
... and 'SetBands()' to 'SetCurrentBands()'.
We'll keep the 'Current' keyword in those properties which also have
'Supported' values.
Diffstat (limited to 'libmm-glib/mm-simple-connect-properties.c')
-rw-r--r-- | libmm-glib/mm-simple-connect-properties.c | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/libmm-glib/mm-simple-connect-properties.c b/libmm-glib/mm-simple-connect-properties.c index 5222e01cd..fa476a194 100644 --- a/libmm-glib/mm-simple-connect-properties.c +++ b/libmm-glib/mm-simple-connect-properties.c @@ -35,7 +35,7 @@ G_DEFINE_TYPE (MMSimpleConnectProperties, mm_simple_connect_properties, G_TYPE_O #define PROPERTY_PIN "pin" #define PROPERTY_OPERATOR_ID "operator-id" -#define PROPERTY_BANDS "bands" +#define PROPERTY_CURRENT_BANDS "current-bands" #define PROPERTY_ALLOWED_MODES "allowed-modes" #define PROPERTY_PREFERRED_MODE "preferred-mode" @@ -45,9 +45,9 @@ struct _MMSimpleConnectPropertiesPrivate { /* Operator ID */ gchar *operator_id; /* Bands */ - gboolean bands_set; - MMModemBand *bands; - guint n_bands; + gboolean current_bands_set; + MMModemBand *current_bands; + guint n_current_bands; /* Modes */ gboolean allowed_modes_set; MMModemMode allowed_modes; @@ -129,7 +129,7 @@ mm_simple_connect_properties_get_operator_id (MMSimpleConnectProperties *self) /*****************************************************************************/ /** - * mm_simple_connect_properties_set_bands: + * mm_simple_connect_properties_set_current_bands: * @self: a #MMSimpleConnectProperties. * @bands: array of #MMModemBand values. * @n_bands: number of elements in @bands. @@ -137,23 +137,23 @@ mm_simple_connect_properties_get_operator_id (MMSimpleConnectProperties *self) * Sets the frequency bands to use. */ void -mm_simple_connect_properties_set_bands (MMSimpleConnectProperties *self, - const MMModemBand *bands, - guint n_bands) +mm_simple_connect_properties_set_current_bands (MMSimpleConnectProperties *self, + const MMModemBand *bands, + guint n_bands) { g_return_if_fail (MM_IS_SIMPLE_CONNECT_PROPERTIES (self)); - g_free (self->priv->bands); - self->priv->n_bands = n_bands; - self->priv->bands = g_new (MMModemBand, self->priv->n_bands); - memcpy (self->priv->bands, + g_free (self->priv->current_bands); + self->priv->n_current_bands = n_bands; + self->priv->current_bands = g_new (MMModemBand, self->priv->n_current_bands); + memcpy (self->priv->current_bands, bands, - sizeof (MMModemBand) * self->priv->n_bands); - self->priv->bands_set = TRUE; + sizeof (MMModemBand) * self->priv->n_current_bands); + self->priv->current_bands_set = TRUE; } /** - * mm_simple_connect_properties_get_bands: + * mm_simple_connect_properties_get_current_bands: * @self: a #MMSimpleConnectProperties. * @bands: (out): location for the array of #MMModemBand values. Do not free the returned value, it is owned by @self. * @n_bands: (out) number of elements in @bands. @@ -163,17 +163,17 @@ mm_simple_connect_properties_set_bands (MMSimpleConnectProperties *self, * Returns: %TRUE if @bands is set, %FALSE otherwise. */ gboolean -mm_simple_connect_properties_get_bands (MMSimpleConnectProperties *self, - const MMModemBand **bands, - guint *n_bands) +mm_simple_connect_properties_get_current_bands (MMSimpleConnectProperties *self, + const MMModemBand **bands, + guint *n_bands) { g_return_val_if_fail (MM_IS_SIMPLE_CONNECT_PROPERTIES (self), FALSE); g_return_val_if_fail (bands != NULL, FALSE); g_return_val_if_fail (n_bands != NULL, FALSE); - if (self->priv->bands_set) { - *bands = self->priv->bands; - *n_bands = self->priv->n_bands; + if (self->priv->current_bands_set) { + *bands = self->priv->current_bands; + *n_bands = self->priv->n_current_bands; return TRUE; } @@ -517,12 +517,12 @@ mm_simple_connect_properties_get_dictionary (MMSimpleConnectProperties *self) PROPERTY_OPERATOR_ID, g_variant_new_string (self->priv->operator_id)); - if (self->priv->bands) + if (self->priv->current_bands) g_variant_builder_add (&builder, "{sv}", - PROPERTY_BANDS, - mm_common_bands_array_to_variant (self->priv->bands, - self->priv->n_bands)); + PROPERTY_CURRENT_BANDS, + mm_common_bands_array_to_variant (self->priv->current_bands, + self->priv->n_current_bands)); if (self->priv->allowed_modes_set) { g_variant_builder_add (&builder, @@ -575,13 +575,13 @@ key_value_foreach (const gchar *key, mm_simple_connect_properties_set_pin (ctx->self, value); else if (g_str_equal (key, PROPERTY_OPERATOR_ID)) mm_simple_connect_properties_set_operator_id (ctx->self, value); - else if (g_str_equal (key, PROPERTY_BANDS)) { + else if (g_str_equal (key, PROPERTY_CURRENT_BANDS)) { MMModemBand *bands = NULL; guint n_bands = 0; mm_common_get_bands_from_string (value, &bands, &n_bands, &ctx->error); if (!ctx->error) { - mm_simple_connect_properties_set_bands (ctx->self, bands, n_bands); + mm_simple_connect_properties_set_current_bands (ctx->self, bands, n_bands); g_free (bands); } } else if (g_str_equal (key, PROPERTY_ALLOWED_MODES)) { @@ -696,11 +696,11 @@ mm_simple_connect_properties_new_from_dictionary (GVariant *dictionary, mm_simple_connect_properties_set_operator_id ( self, g_variant_get_string (value, NULL)); - else if (g_str_equal (key, PROPERTY_BANDS)) { + else if (g_str_equal (key, PROPERTY_CURRENT_BANDS)) { GArray *array; array = mm_common_bands_variant_to_garray (value); - mm_simple_connect_properties_set_bands ( + mm_simple_connect_properties_set_current_bands ( self, (MMModemBand *)array->data, array->len); @@ -781,9 +781,9 @@ mm_simple_connect_properties_init (MMSimpleConnectProperties *self) self->priv->bearer_properties = mm_bearer_properties_new (); self->priv->allowed_modes = MM_MODEM_MODE_ANY; self->priv->preferred_mode = MM_MODEM_MODE_NONE; - self->priv->bands = g_new (MMModemBand, 1); - self->priv->bands[0] = MM_MODEM_BAND_UNKNOWN; - self->priv->n_bands = 1; + self->priv->current_bands = g_new (MMModemBand, 1); + self->priv->current_bands[0] = MM_MODEM_BAND_UNKNOWN; + self->priv->n_current_bands = 1; } static void @@ -793,7 +793,7 @@ finalize (GObject *object) g_free (self->priv->pin); g_free (self->priv->operator_id); - g_free (self->priv->bands); + g_free (self->priv->current_bands); g_object_unref (self->priv->bearer_properties); G_OBJECT_CLASS (mm_simple_connect_properties_parent_class)->finalize (object); |