core: move helper macro for activating state to general location
This commit is contained in:
@@ -42,8 +42,6 @@
|
|||||||
#include "nm-vpn-manager.h"
|
#include "nm-vpn-manager.h"
|
||||||
#include "nm-modem.h"
|
#include "nm-modem.h"
|
||||||
|
|
||||||
#define STATE_IN_ACTIVATION_PHASE(state) ((state > NM_DEVICE_STATE_DISCONNECTED) && (state < NM_DEVICE_STATE_ACTIVATED))
|
|
||||||
|
|
||||||
typedef struct LookupThread LookupThread;
|
typedef struct LookupThread LookupThread;
|
||||||
|
|
||||||
typedef void (*LookupCallback) (LookupThread *thread, gpointer user_data);
|
typedef void (*LookupCallback) (LookupThread *thread, gpointer user_data);
|
||||||
@@ -788,7 +786,7 @@ device_state_changed (NMDevice *device,
|
|||||||
/* Mark the connection invalid if it failed during activation so that
|
/* Mark the connection invalid if it failed during activation so that
|
||||||
* it doesn't get automatically chosen over and over and over again.
|
* it doesn't get automatically chosen over and over and over again.
|
||||||
*/
|
*/
|
||||||
if (connection && STATE_IN_ACTIVATION_PHASE (old_state)) {
|
if (connection && IS_ACTIVATING_STATE (old_state)) {
|
||||||
g_object_set_data (G_OBJECT (connection), INVALID_TAG, GUINT_TO_POINTER (TRUE));
|
g_object_set_data (G_OBJECT (connection), INVALID_TAG, GUINT_TO_POINTER (TRUE));
|
||||||
nm_info ("Marking connection '%s' invalid.", get_connection_id (connection));
|
nm_info ("Marking connection '%s' invalid.", get_connection_id (connection));
|
||||||
nm_connection_clear_secrets (connection);
|
nm_connection_clear_secrets (connection);
|
||||||
|
@@ -32,6 +32,9 @@
|
|||||||
#define NM_IS_DEVICE_INTERFACE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DEVICE_INTERFACE))
|
#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 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
|
typedef enum
|
||||||
{
|
{
|
||||||
NM_DEVICE_INTERFACE_ERROR_CONNECTION_ACTIVATING = 0,
|
NM_DEVICE_INTERFACE_ERROR_CONNECTION_ACTIVATING = 0,
|
||||||
|
Reference in New Issue
Block a user