From c9354cb47771263b0762e0400de1b894fa480cd1 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 21 Nov 2018 08:24:55 +0100 Subject: [PATCH] keep-alive: drop unused nm_keep_alive_set_forced() set-forced is currently unused, so drop it. NMKeepAlive in principle determines the alive-status based on multiple aspects, that in combination render the instance alive or dead. These aspects cooperate in a particular way. By default, a keep-alive instance should be alive. If there are conditions enabled that further determine the alive-state, then these conditions cooperate in a particular way. As it was, the force-flag would just overrule them all. But is that useful? The nm_keep_alive_set_forced() API also means that only one user caller can have control over the flag. Independent callers cannot cooperate on setting the flag, because there is no reference-counting or registered handles. At least today, it's unclear whether this flag really should overrule all other conditions and how this flag would actually be used. Drop it for now. --- src/nm-keep-alive.c | 17 ----------------- src/nm-keep-alive.h | 3 --- 2 files changed, 20 deletions(-) diff --git a/src/nm-keep-alive.c b/src/nm-keep-alive.c index 4af6c38ddb..c519ceb756 100644 --- a/src/nm-keep-alive.c +++ b/src/nm-keep-alive.c @@ -46,7 +46,6 @@ typedef struct { bool armed:1; bool disarmed:1; - bool forced:1; bool alive:1; bool dbus_client_confirmed:1; } NMKeepAlivePrivate; @@ -88,9 +87,6 @@ _is_alive (NMKeepAlive *self) return TRUE; } - if (priv->forced) - return TRUE; - if ( priv->connection && NM_FLAGS_HAS (nm_settings_connection_get_flags (priv->connection), NM_SETTINGS_CONNECTION_INT_FLAGS_VISIBLE)) @@ -129,19 +125,6 @@ nm_keep_alive_is_alive (NMKeepAlive *self) /*****************************************************************************/ -void -nm_keep_alive_set_forced (NMKeepAlive *self, gboolean forced) -{ - NMKeepAlivePrivate *priv = NM_KEEP_ALIVE_GET_PRIVATE (self); - - if (priv->forced != (!!forced)) { - priv->forced = forced; - _notify_alive (self); - } -} - -/*****************************************************************************/ - static void connection_flags_changed (NMSettingsConnection *connection, NMKeepAlive *self) diff --git a/src/nm-keep-alive.h b/src/nm-keep-alive.h index 72133224cd..160b2adb58 100644 --- a/src/nm-keep-alive.h +++ b/src/nm-keep-alive.h @@ -43,9 +43,6 @@ gboolean nm_keep_alive_is_alive (NMKeepAlive *self); void nm_keep_alive_arm (NMKeepAlive *self); void nm_keep_alive_disarm (NMKeepAlive *self); -void nm_keep_alive_set_forced (NMKeepAlive *self, - gboolean forced); - void nm_keep_alive_set_settings_connection_watch_visible (NMKeepAlive *self, NMSettingsConnection *connection);