diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/uccs-server.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/src/uccs-server.c b/src/uccs-server.c index c83db35..b045673 100644 --- a/src/uccs-server.c +++ b/src/uccs-server.c @@ -112,19 +112,23 @@ uccs_server_init (UccsServer *self) /* Start as unavailable */ self->parent.state = SERVER_STATE_UNAVAILABLE; - if (global_client == NULL) { - global_client = nm_client_new(); + if (g_strcmp0(g_getenv("DBUS_TEST_RUNNER"), "1")) { - if (global_client != NULL) { - g_object_add_weak_pointer(G_OBJECT(global_client), (gpointer *)&global_client); - self->nm_client = global_client; + if (global_client == NULL) { + global_client = nm_client_new(); + + if (global_client != NULL) { + g_object_add_weak_pointer(G_OBJECT(global_client), (gpointer *)&global_client); + self->nm_client = global_client; + } + } else { + self->nm_client = g_object_ref(global_client); + } + + if (self->nm_client != NULL) { + self->nm_signal = g_signal_connect(self->nm_client, "notify::" NM_CLIENT_STATE, G_CALLBACK(nm_state_changed), self); } - } else { - self->nm_client = g_object_ref(global_client); - } - if (self->nm_client != NULL) { - self->nm_signal = g_signal_connect(self->nm_client, "notify::" NM_CLIENT_STATE, G_CALLBACK(nm_state_changed), self); } self->verify_server = TRUE; |