core: kill IS_ACTIVATING_STATE()

This commit is contained in:
Dan Williams 2011-11-17 22:56:51 -06:00
parent f8852bf4a4
commit 777d9cb182
4 changed files with 6 additions and 9 deletions

View file

@ -611,7 +611,7 @@ nm_modem_device_state_changed (NMModem *self,
g_return_if_fail (self != NULL);
g_return_if_fail (NM_IS_MODEM (self));
if (IS_ACTIVATING_STATE (old_state) || (old_state == NM_DEVICE_STATE_ACTIVATED))
if (old_state >= NM_DEVICE_STATE_PREPARE && old_state <= NM_DEVICE_STATE_ACTIVATED)
was_connected = TRUE;
priv = NM_MODEM_GET_PRIVATE (self);

View file

@ -32,9 +32,6 @@
#define NM_IS_DEVICE_INTERFACE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DEVICE_INTERFACE))
#define NM_DEVICE_INTERFACE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), NM_TYPE_DEVICE_INTERFACE, NMDeviceInterface))
#define IS_ACTIVATING_STATE(state) \
(state > NM_DEVICE_STATE_DISCONNECTED && state < NM_DEVICE_STATE_ACTIVATED)
typedef enum
{
NM_DEVICE_INTERFACE_ERROR_CONNECTION_ACTIVATING = 0,

View file

@ -1035,7 +1035,9 @@ device_state_changed (NMDevice *device,
/* Mark the connection invalid if it failed during activation so that
* it doesn't get automatically chosen over and over and over again.
*/
if (connection && IS_ACTIVATING_STATE (old_state)) {
if ( connection
&& old_state >= NM_DEVICE_STATE_PREPARE
&& old_state <= NM_DEVICE_STATE_ACTIVATED) {
guint32 tries = get_connection_auto_retries (connection);
if (reason == NM_DEVICE_STATE_REASON_NO_SECRETS) {

View file

@ -918,7 +918,7 @@ wmx_state_change_cb (struct wmxsdk *wmxsdk,
}
/* Handle activation success and failure */
if (IS_ACTIVATING_STATE (state)) {
if (nm_device_is_activating (NM_DEVICE (self))) {
if (new_status == WIMAX_API_DEVICE_STATUS_Data_Connected) {
/* Success */
clear_activation_timeout (self);
@ -1033,10 +1033,8 @@ wmx_connect_result_cb (struct wmxsdk *wmxsdk,
{
NMDeviceWimax *self = NM_DEVICE_WIMAX (user_data);
NMDeviceWimaxPrivate *priv = NM_DEVICE_WIMAX_GET_PRIVATE (self);
NMDeviceState state;
state = nm_device_get_state (NM_DEVICE (self));
if (IS_ACTIVATING_STATE (state)) {
if (nm_device_is_activating (NM_DEVICE (self))) {
priv->connect_failed = (result == WIMAX_API_CONNECTION_SUCCESS);
/* Wait for the state change so we can get the reason code; we
* cache the connect failure so we don't have to wait for the