[network-manager-applet] applet, editor: let libnm-glib create our bus connections
- From: Dan Williams <dcbw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [network-manager-applet] applet, editor: let libnm-glib create our bus connections
- Date: Thu, 11 Apr 2013 16:25:04 +0000 (UTC)
commit e279c38104ef6507e28cc18841033f5b6f82721e
Author: Dan Williams <dcbw redhat com>
Date: Thu Mar 21 16:28:06 2013 -0500
applet,editor: let libnm-glib create our bus connections
src/applet.c | 13 +------------
src/applet.h | 2 --
src/connection-editor/nm-connection-list.c | 11 +----------
3 files changed, 2 insertions(+), 24 deletions(-)
---
diff --git a/src/applet.c b/src/applet.c
index 4b875f2..83e5e23 100644
--- a/src/applet.c
+++ b/src/applet.c
@@ -3338,18 +3338,10 @@ shell_version_changed_cb (NMShellWatcher *watcher, GParamSpec *pspec, gpointer u
static gboolean
dbus_setup (NMApplet *applet, GError **error)
{
- DBusConnection *connection;
DBusGProxy *proxy;
guint result;
gboolean success;
- applet->bus = dbus_g_bus_get (DBUS_BUS_SYSTEM, error);
- if (!applet->bus)
- return FALSE;
-
- connection = dbus_g_connection_get_connection (applet->bus);
- dbus_connection_set_exit_on_disconnect (connection, FALSE);
-
applet->session_bus = dbus_g_bus_get (DBUS_BUS_SESSION, error);
if (!applet->session_bus)
return FALSE;
@@ -3427,7 +3419,7 @@ constructor (GType type,
g_error_free (error);
goto error;
}
- applet->settings = nm_remote_settings_new (applet->bus);
+ applet->settings = nm_remote_settings_new (NULL);
#ifdef BUILD_MIGRATION_TOOL
{
@@ -3563,9 +3555,6 @@ static void finalize (GObject *object)
if (applet->settings)
g_object_unref (applet->settings);
- if (applet->bus)
- dbus_g_connection_unref (applet->bus);
-
if (applet->session_bus)
dbus_g_connection_unref (applet->session_bus);
diff --git a/src/applet.h b/src/applet.h
index 1048e30..647500b 100644
--- a/src/applet.h
+++ b/src/applet.h
@@ -31,7 +31,6 @@
#include <gtk/gtk.h>
#include <gdk/gdkx.h>
-#include <dbus/dbus.h>
#include <dbus/dbus-glib.h>
#include <net/ethernet.h>
@@ -86,7 +85,6 @@ typedef struct
GObject parent_instance;
GMainLoop *loop;
- DBusGConnection *bus;
DBusGConnection *session_bus;
NMShellWatcher *shell_watcher;
diff --git a/src/connection-editor/nm-connection-list.c b/src/connection-editor/nm-connection-list.c
index f445edf..15b5c25 100644
--- a/src/connection-editor/nm-connection-list.c
+++ b/src/connection-editor/nm-connection-list.c
@@ -850,7 +850,6 @@ NMConnectionList *
nm_connection_list_new (void)
{
NMConnectionList *list;
- DBusGConnection *bus;
GError *error = NULL;
const char *objects[] = { "NMConnectionList", NULL };
@@ -876,15 +875,7 @@ nm_connection_list_new (void)
if (!list->nm_client)
goto error;
- bus = dbus_g_bus_get (DBUS_BUS_SYSTEM, &error);
- if (error) {
- g_warning ("Could not connect to the system bus: %s", error->message);
- g_error_free (error);
- goto error;
- }
-
- list->settings = nm_remote_settings_new (bus);
- dbus_g_connection_unref (bus);
+ list->settings = nm_remote_settings_new (NULL);
g_signal_connect (list->settings,
NM_REMOTE_SETTINGS_NEW_CONNECTION,
G_CALLBACK (connection_added),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]