diff --git a/src/devices/bluetooth/nm-bluez-device.c b/src/devices/bluetooth/nm-bluez-device.c index 182527d9f5..bd3cf18a67 100644 --- a/src/devices/bluetooth/nm-bluez-device.c +++ b/src/devices/bluetooth/nm-bluez-device.c @@ -1185,7 +1185,8 @@ dispose (GObject *object) if (priv->pan_connection) { /* Check whether we want to remove the created connection. If so, we take a reference * and delete it at the end of dispose(). */ - if (nm_settings_connection_get_nm_generated (NM_SETTINGS_CONNECTION (priv->pan_connection))) + if (NM_FLAGS_HAS (nm_settings_connection_get_flags (NM_SETTINGS_CONNECTION (priv->pan_connection)), + NM_SETTINGS_CONNECTION_FLAGS_NM_GENERATED)) to_delete = g_object_ref (priv->pan_connection); priv->pan_connection = NULL; diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 1ac4e60dbf..8183908b39 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -10173,7 +10173,8 @@ nm_device_set_ip4_config (NMDevice *self, if ( nm_device_sys_iface_state_is_external (self) && (settings_connection = nm_device_get_settings_connection (self)) - && nm_settings_connection_get_nm_generated (settings_connection) + && NM_FLAGS_HAS (nm_settings_connection_get_flags (settings_connection), + NM_SETTINGS_CONNECTION_FLAGS_NM_GENERATED) && nm_active_connection_get_activation_type (NM_ACTIVE_CONNECTION (priv->act_request)) == NM_ACTIVATION_TYPE_EXTERNAL) { NMSetting *s_ip4; @@ -10344,7 +10345,8 @@ nm_device_set_ip6_config (NMDevice *self, if ( nm_device_sys_iface_state_is_external (self) && (settings_connection = nm_device_get_settings_connection (self)) - && nm_settings_connection_get_nm_generated (settings_connection) + && NM_FLAGS_HAS (nm_settings_connection_get_flags (settings_connection), + NM_SETTINGS_CONNECTION_FLAGS_NM_GENERATED) && nm_active_connection_get_activation_type (NM_ACTIVE_CONNECTION (priv->act_request)) == NM_ACTIVATION_TYPE_EXTERNAL) { NMSetting *s_ip6; diff --git a/src/nm-active-connection.c b/src/nm-active-connection.c index c27f6548eb..2286a74b4f 100644 --- a/src/nm-active-connection.c +++ b/src/nm-active-connection.c @@ -866,7 +866,8 @@ _settings_connection_notify_flags (NMSettingsConnection *settings_connection, nm_assert (nm_active_connection_get_activation_type (self) == NM_ACTIVATION_TYPE_EXTERNAL); nm_assert (NM_ACTIVE_CONNECTION_GET_PRIVATE (self)->settings_connection == settings_connection); - if (nm_settings_connection_get_nm_generated (settings_connection)) + if (NM_FLAGS_HAS (nm_settings_connection_get_flags (settings_connection), + NM_SETTINGS_CONNECTION_FLAGS_NM_GENERATED)) return; _set_activation_type_managed (self); diff --git a/src/nm-manager.c b/src/nm-manager.c index 48e48fe100..ada8ed8945 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -328,7 +328,8 @@ active_connection_remove (NMManager *self, NMActiveConnection *active) g_signal_handlers_disconnect_by_func (active, active_connection_parent_active, self); if ( (connection = nm_active_connection_get_settings_connection (active)) - && nm_settings_connection_get_volatile (connection)) + && NM_FLAGS_HAS (nm_settings_connection_get_flags (connection), + NM_SETTINGS_CONNECTION_FLAGS_VOLATILE)) g_object_ref (connection); else connection = NULL; @@ -497,7 +498,8 @@ _get_activatable_connections_filter (NMSettings *settings, NMSettingsConnection *connection, gpointer user_data) { - if (nm_settings_connection_get_volatile (connection)) + if (NM_FLAGS_HAS (nm_settings_connection_get_flags (connection), + NM_SETTINGS_CONNECTION_FLAGS_VOLATILE)) return FALSE; return !active_connection_find_first (user_data, connection, NULL, NM_ACTIVE_CONNECTION_STATE_DEACTIVATING); } diff --git a/src/nm-policy.c b/src/nm-policy.c index 20a1a53ea1..8b507a5808 100644 --- a/src/nm-policy.c +++ b/src/nm-policy.c @@ -1224,7 +1224,8 @@ auto_activate_device (NMPolicy *self, NMSettingConnection *s_con; const char *permission; - if ( !nm_settings_connection_is_visible (candidate) + if ( !NM_FLAGS_HAS (nm_settings_connection_get_flags (candidate), + NM_SETTINGS_CONNECTION_FLAGS_VISIBLE) || nm_settings_connection_autoconnect_is_blocked (candidate)) continue; @@ -2382,7 +2383,8 @@ connection_flags_changed (NMSettings *settings, NMPolicyPrivate *priv = user_data; NMPolicy *self = _PRIV_TO_SELF (priv); - if (nm_settings_connection_is_visible (connection)) + if (NM_FLAGS_HAS (nm_settings_connection_get_flags (connection), + NM_SETTINGS_CONNECTION_FLAGS_VISIBLE)) schedule_activate_all (self); else _deactivate_if_active (self, connection); diff --git a/src/settings/nm-settings-connection.c b/src/settings/nm-settings-connection.c index 45caffb9f5..80f7b290fb 100644 --- a/src/settings/nm-settings-connection.c +++ b/src/settings/nm-settings-connection.c @@ -324,14 +324,6 @@ set_visible (NMSettingsConnection *self, gboolean new_visible) new_visible); } -gboolean -nm_settings_connection_is_visible (NMSettingsConnection *self) -{ - g_return_val_if_fail (NM_IS_SETTINGS_CONNECTION (self), FALSE); - - return NM_FLAGS_HAS (NM_SETTINGS_CONNECTION_GET_PRIVATE (self)->flags, NM_SETTINGS_CONNECTION_FLAGS_VISIBLE); -} - void nm_settings_connection_recheck_visibility (NMSettingsConnection *self) { @@ -397,7 +389,8 @@ nm_settings_connection_check_permission (NMSettingsConnection *self, priv = NM_SETTINGS_CONNECTION_GET_PRIVATE (self); - if (!nm_settings_connection_is_visible (self)) + if (!NM_FLAGS_HAS (nm_settings_connection_get_flags (self), + NM_SETTINGS_CONNECTION_FLAGS_VISIBLE)) return FALSE; s_con = nm_connection_get_setting_connection (NM_CONNECTION (self)); @@ -2750,37 +2743,6 @@ nm_settings_connection_autoconnect_is_blocked (NMSettingsConnection *self) /*****************************************************************************/ -/** - * nm_settings_connection_get_nm_generated: - * @self: an #NMSettingsConnection - * - * Gets the "nm-generated" flag on @self. - * - * A connection is "nm-generated" if it was generated by - * nm_device_generate_connection() and has not been modified or - * saved by the user since then. - */ -gboolean -nm_settings_connection_get_nm_generated (NMSettingsConnection *self) -{ - return NM_FLAGS_HAS (nm_settings_connection_get_flags (self), NM_SETTINGS_CONNECTION_FLAGS_NM_GENERATED); -} - -/** - * nm_settings_connection_get_volatile: - * @self: an #NMSettingsConnection - * - * Gets the "volatile" flag on @self. - * - * The connection is marked as volatile and will be removed when - * it disconnects. - */ -gboolean -nm_settings_connection_get_volatile (NMSettingsConnection *self) -{ - return NM_FLAGS_HAS (nm_settings_connection_get_flags (self), NM_SETTINGS_CONNECTION_FLAGS_VOLATILE); -} - gboolean nm_settings_connection_get_ready (NMSettingsConnection *self) { diff --git a/src/settings/nm-settings-connection.h b/src/settings/nm-settings-connection.h index 0c10e1ca8c..7615fb4655 100644 --- a/src/settings/nm-settings-connection.h +++ b/src/settings/nm-settings-connection.h @@ -176,8 +176,6 @@ NMSettingsConnectionCallId *nm_settings_connection_get_secrets (NMSettingsConnec void nm_settings_connection_cancel_secrets (NMSettingsConnection *self, NMSettingsConnectionCallId *call_id); -gboolean nm_settings_connection_is_visible (NMSettingsConnection *self); - void nm_settings_connection_recheck_visibility (NMSettingsConnection *self); gboolean nm_settings_connection_check_permission (NMSettingsConnection *self, @@ -238,9 +236,6 @@ nm_settings_connection_autoconnect_blocked_reason_set (NMSettingsConnection *sel gboolean nm_settings_connection_autoconnect_is_blocked (NMSettingsConnection *self); -gboolean nm_settings_connection_get_nm_generated (NMSettingsConnection *self); -gboolean nm_settings_connection_get_volatile (NMSettingsConnection *self); - gboolean nm_settings_connection_get_ready (NMSettingsConnection *self); void nm_settings_connection_set_ready (NMSettingsConnection *self, gboolean ready);