Commit c9354cb4 authored by Thomas Haller's avatar Thomas Haller

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
parent f95a5263
......@@ -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),
......@@ -129,19 +125,6 @@ nm_keep_alive_is_alive (NMKeepAlive *self)
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)
......@@ -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);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment