device: expose nm_device_set_autoconnect() function

This commit is contained in:
Thomas Haller
2015-11-05 07:52:51 +01:00
parent 4f5cd099be
commit 3b6602b656
5 changed files with 5 additions and 4 deletions

View File

@@ -458,7 +458,7 @@ modem_prepare_result (NMModem *modem,
* the device to be auto-activated anymore, which would risk locking * the device to be auto-activated anymore, which would risk locking
* the SIM if the incorrect PIN continues to be used. * the SIM if the incorrect PIN continues to be used.
*/ */
g_object_set (G_OBJECT (device), NM_DEVICE_AUTOCONNECT, FALSE, NULL); nm_device_set_autoconnect (device, FALSE);
_LOGI (LOGD_MB, "disabling autoconnect due to failed SIM PIN"); _LOGI (LOGD_MB, "disabling autoconnect due to failed SIM PIN");
} }

View File

@@ -2524,7 +2524,7 @@ nm_device_get_autoconnect (NMDevice *self)
return NM_DEVICE_GET_PRIVATE (self)->autoconnect; return NM_DEVICE_GET_PRIVATE (self)->autoconnect;
} }
static void void
nm_device_set_autoconnect (NMDevice *self, gboolean autoconnect) nm_device_set_autoconnect (NMDevice *self, gboolean autoconnect)
{ {
NMDevicePrivate *priv; NMDevicePrivate *priv;

View File

@@ -503,6 +503,7 @@ gboolean nm_device_unrealize (NMDevice *device,
GError **error); GError **error);
gboolean nm_device_get_autoconnect (NMDevice *device); gboolean nm_device_get_autoconnect (NMDevice *device);
void nm_device_set_autoconnect (NMDevice *device, gboolean autoconnect);
void nm_device_state_changed (NMDevice *device, void nm_device_state_changed (NMDevice *device,
NMDeviceState state, NMDeviceState state,

View File

@@ -106,7 +106,7 @@ modem_prepare_result (NMModem *modem,
* the device to be auto-activated anymore, which would risk locking * the device to be auto-activated anymore, which would risk locking
* the SIM if the incorrect PIN continues to be used. * the SIM if the incorrect PIN continues to be used.
*/ */
g_object_set (G_OBJECT (device), NM_DEVICE_AUTOCONNECT, FALSE, NULL); nm_device_set_autoconnect (device, FALSE);
_LOGI (LOGD_MB, "disabling autoconnect due to failed SIM PIN"); _LOGI (LOGD_MB, "disabling autoconnect due to failed SIM PIN");
} }

View File

@@ -3795,7 +3795,7 @@ do_sleep_wake (NMManager *self, gboolean sleeping_changed)
nm_device_set_enabled (device, enabled); nm_device_set_enabled (device, enabled);
} }
g_object_set (G_OBJECT (device), NM_DEVICE_AUTOCONNECT, TRUE, NULL); nm_device_set_autoconnect (device, TRUE);
nm_device_set_unmanaged_flags (device, NM_UNMANAGED_INTERNAL, FALSE, NM_DEVICE_STATE_REASON_NOW_MANAGED); nm_device_set_unmanaged_flags (device, NM_UNMANAGED_INTERNAL, FALSE, NM_DEVICE_STATE_REASON_NOW_MANAGED);
} }