core: use Config object for connectivity checking parameters

This commit is contained in:
Dan Williams 2013-02-01 08:46:16 -06:00
parent 2e0fead744
commit 875c1af2fd
5 changed files with 12 additions and 19 deletions

View file

@ -538,9 +538,6 @@ main (int argc, char *argv[])
wifi_enabled,
wwan_enabled,
wimax_enabled,
nm_config_get_connectivity_uri (config),
nm_config_get_connectivity_interval (config),
nm_config_get_connectivity_response (config),
&error);
if (manager == NULL) {
nm_log_err (LOGD_CORE, "failed to initialize the network manager: %s",

View file

@ -26,7 +26,7 @@
#include "nm-connectivity.h"
#include "nm-logging.h"
#include "nm-manager.h"
#include "nm-config.h"
G_DEFINE_TYPE (NMConnectivity, nm_connectivity, G_TYPE_OBJECT)
@ -190,19 +190,23 @@ nm_connectivity_stop_check (NMConnectivity *self)
}
NMConnectivity *
nm_connectivity_new (const gchar *check_uri,
guint check_interval,
const gchar *check_response)
nm_connectivity_new (void)
{
NMConnectivity *self;
NMConfig *config;
const char *check_response;
config = nm_config_get ();
check_response = nm_config_get_connectivity_response (config);
self = g_object_new (NM_TYPE_CONNECTIVITY,
NM_CONNECTIVITY_URI, check_uri,
NM_CONNECTIVITY_INTERVAL, check_interval,
NM_CONNECTIVITY_URI, nm_config_get_connectivity_uri (config),
NM_CONNECTIVITY_INTERVAL, nm_config_get_connectivity_interval (config),
NM_CONNECTIVITY_RESPONSE, check_response ? check_response : DEFAULT_RESPONSE,
NULL);
g_return_val_if_fail (self != NULL, NULL);
update_connected (self, FALSE);
g_object_unref (config);
return self;
}

View file

@ -53,9 +53,7 @@ typedef struct {
GType nm_connectivity_get_type (void);
NMConnectivity *nm_connectivity_new (const gchar *check_uri,
guint check_interval,
const gchar *check_response);
NMConnectivity *nm_connectivity_new (void);
void nm_connectivity_start_check (NMConnectivity *connectivity);

View file

@ -4081,9 +4081,6 @@ nm_manager_new (NMSettings *settings,
gboolean initial_wifi_enabled,
gboolean initial_wwan_enabled,
gboolean initial_wimax_enabled,
const gchar *connectivity_uri,
gint connectivity_interval,
const gchar *connectivity_response,
GError **error)
{
NMManagerPrivate *priv;
@ -4100,7 +4097,7 @@ nm_manager_new (NMSettings *settings,
priv = NM_MANAGER_GET_PRIVATE (singleton);
#if WITH_CONCHECK
priv->connectivity = nm_connectivity_new (connectivity_uri, connectivity_interval, connectivity_response);
priv->connectivity = nm_connectivity_new ();
g_signal_connect (priv->connectivity, "notify::" NM_CONNECTIVITY_CONNECTED,
G_CALLBACK (connectivity_changed), singleton);

View file

@ -92,9 +92,6 @@ NMManager *nm_manager_new (NMSettings *settings,
gboolean initial_wifi_enabled,
gboolean initial_wwan_enabled,
gboolean initial_wimax_enabled,
const gchar *connectivity_uri,
gint connectivity_interval,
const gchar *connectivity_response,
GError **error);
NMManager *nm_manager_get (void);