Commit a1e811b4 authored by Thomas Haller's avatar Thomas Haller

keep-alive: drop "floating" argument from nm_keep_alive_new()

All callers only want to create floating instances at first.
Also, it seems to make generally more sense this way: you create
a floating instance, set it up, and then arm it.

This simplifies nm_keep_alive_new(), which previously was adding
additional code that wasn't accessible via plain g_object_new().
parent 15033be1
......@@ -1446,7 +1446,7 @@ nm_active_connection_init (NMActiveConnection *self)
priv->activation_type = NM_ACTIVATION_TYPE_MANAGED;
priv->version_id = _version_id_new ();
priv->keep_alive = nm_keep_alive_new (TRUE);
priv->keep_alive = nm_keep_alive_new ();
g_signal_connect_object (priv->keep_alive, "notify::" NM_KEEP_ALIVE_ALIVE,
(GCallback) keep_alive_alive_changed,
......@@ -382,19 +382,18 @@ get_property (GObject *object,
static void
nm_keep_alive_init (NMKeepAlive *self)
nm_assert (NM_KEEP_ALIVE_GET_PRIVATE (self)->alive == _is_alive (self));
NMKeepAlive *
nm_keep_alive_new (gboolean floating)
NMKeepAlive *self = g_object_new (NM_TYPE_KEEP_ALIVE, NULL);
NMKeepAlivePrivate *priv = NM_KEEP_ALIVE_GET_PRIVATE (self);
priv->floating = floating;
priv->floating = TRUE;
priv->alive = TRUE;
nm_assert (priv->alive == _is_alive (self));
return self;
NMKeepAlive *
nm_keep_alive_new (void)
return g_object_new (NM_TYPE_KEEP_ALIVE, NULL);
static void
......@@ -36,7 +36,7 @@ typedef struct _NMKeepAliveClass NMKeepAliveClass;
GType nm_keep_alive_get_type (void) G_GNUC_CONST;
NMKeepAlive* nm_keep_alive_new (gboolean floating);
NMKeepAlive* nm_keep_alive_new (void);
gboolean nm_keep_alive_is_alive (NMKeepAlive *self);
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