Commit 2afc1d7c authored by Thomas Haller's avatar Thomas Haller
Browse files

wwan: don't use generated enum-type NM_TYPE_MODEM_STATE

parent a6d34f9a
......@@ -582,10 +582,12 @@ modem_cleanup (NMDeviceBt *self)
static void
modem_state_cb (NMModem *modem,
NMModemState new_state,
NMModemState old_state,
int new_state_i,
int old_state_i,
gpointer user_data)
{
NMModemState new_state = new_state_i;
NMModemState old_state = old_state_i;
NMDevice *device = NM_DEVICE (user_data);
NMDeviceState dev_state = nm_device_get_state (device);
......
......@@ -287,10 +287,12 @@ ids_changed_cb (NMModem *modem, GParamSpec *pspec, gpointer user_data)
static void
modem_state_cb (NMModem *modem,
NMModemState new_state,
NMModemState old_state,
int new_state_i,
int old_state_i,
gpointer user_data)
{
NMModemState new_state = new_state_i;
NMModemState old_state = old_state_i;
NMDevice *device = NM_DEVICE (user_data);
NMDeviceModemPrivate *priv = NM_DEVICE_MODEM_GET_PRIVATE ((NMDeviceModem *) device);
NMDeviceState dev_state = nm_device_get_state (device);
......
......@@ -1396,7 +1396,7 @@ nm_modem_broadband_new (GObject *object, GError **error)
NM_MODEM_CONTROL_PORT, mm_modem_get_primary_port (modem_iface),
NM_MODEM_DATA_PORT, NULL, /* We don't know it until bearer created */
NM_MODEM_IP_TYPES, mm_ip_family_to_nm (mm_modem_get_supported_ip_families (modem_iface)),
NM_MODEM_STATE, mm_state_to_nm (mm_modem_get_state (modem_iface)),
NM_MODEM_STATE, (int) mm_state_to_nm (mm_modem_get_state (modem_iface)),
NM_MODEM_DEVICE_ID, mm_modem_get_device_identifier (modem_iface),
NM_MODEM_BROADBAND_MODEM, modem_object,
NM_MODEM_DRIVER, drivers,
......
......@@ -1153,7 +1153,7 @@ nm_modem_ofono_new (const char *path)
NM_MODEM_DEVICE_ID, basename,
NM_MODEM_CONTROL_PORT, "ofono", /* mandatory */
NM_MODEM_DRIVER, "ofono",
NM_MODEM_STATE, NM_MODEM_STATE_INITIALIZING,
NM_MODEM_STATE, (int) NM_MODEM_STATE_INITIALIZING,
NULL);
}
......
......@@ -158,7 +158,7 @@ nm_modem_set_state (NMModem *self,
priv->state = new_state;
_notify (self, PROP_STATE);
g_signal_emit (self, signals[STATE_CHANGED], 0, new_state, old_state, reason);
g_signal_emit (self, signals[STATE_CHANGED], 0, (int) new_state, (int) old_state, reason);
}
}
......@@ -1366,7 +1366,7 @@ get_property (GObject *object, guint prop_id,
g_value_set_uint (value, priv->mm_ip_timeout);
break;
case PROP_STATE:
g_value_set_enum (value, priv->state);
g_value_set_int (value, priv->state);
break;
case PROP_DEVICE_ID:
g_value_set_string (value, priv->device_id);
......@@ -1424,10 +1424,11 @@ set_property (GObject *object, guint prop_id,
priv->mm_ip_timeout = g_value_get_uint (value);
break;
case PROP_STATE:
priv->state = g_value_get_enum (value);
/* construct-only */
priv->state = g_value_get_int (value);
break;
case PROP_DEVICE_ID:
/* construct only */
/* construct-only */
priv->device_id = g_value_dup_string (value);
break;
case PROP_SIM_ID:
......@@ -1592,11 +1593,10 @@ nm_modem_class_init (NMModemClass *klass)
G_PARAM_STATIC_STRINGS);
obj_properties[PROP_STATE] =
g_param_spec_enum (NM_MODEM_STATE, "", "",
NM_TYPE_MODEM_STATE,
NM_MODEM_STATE_UNKNOWN,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS);
g_param_spec_int (NM_MODEM_STATE, "", "",
NM_MODEM_STATE_UNKNOWN, _NM_MODEM_STATE_LAST, NM_MODEM_STATE_UNKNOWN,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS);
obj_properties[PROP_DEVICE_ID] =
g_param_spec_string (NM_MODEM_DEVICE_ID, "", "",
......@@ -1701,5 +1701,5 @@ nm_modem_class_init (NMModemClass *klass)
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_FIRST,
0, NULL, NULL, NULL,
G_TYPE_NONE, 2, NM_TYPE_MODEM_STATE, NM_TYPE_MODEM_STATE);
G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_INT);
}
......@@ -98,6 +98,9 @@ typedef enum { /*< underscore_name=nm_modem_state >*/
NM_MODEM_STATE_DISCONNECTING = 10,
NM_MODEM_STATE_CONNECTING = 11,
NM_MODEM_STATE_CONNECTED = 12,
_NM_MODEM_STATE_LAST0,
_NM_MODEM_STATE_LAST = _NM_MODEM_STATE_LAST0 -1,
} NMModemState;
struct _NMModemPrivate;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment