aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--shell/ChangeLog4
-rw-r--r--shell/e-shell-nm-glib.c14
2 files changed, 12 insertions, 6 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog
index 52805c3a7d..7748c54833 100644
--- a/shell/ChangeLog
+++ b/shell/ChangeLog
@@ -1,3 +1,7 @@
+2006-02-05 Shreyas Srinivasan <sshreyas@novell.com>
+
+ * e-shell-nm-glib.c: init the nm-dbus connection once.
+
2006-01-29 Kjartan Maraas <kmaraas@gnome.org>
* e-corba-config-page.c: (e_corba_config_page_class_init):
diff --git a/shell/e-shell-nm-glib.c b/shell/e-shell-nm-glib.c
index 8ebb0b7eff..9c6a8fd67d 100644
--- a/shell/e-shell-nm-glib.c
+++ b/shell/e-shell-nm-glib.c
@@ -30,6 +30,7 @@
#include <NetworkManager/libnm_glib.h>
#include <e-shell-window.h>
+static libnm_glib_ctx *nm_ctx = NULL;
static void e_shell_glib_network_monitor (libnm_glib_ctx *ctx, gpointer user_data)
{
@@ -59,17 +60,18 @@ static void e_shell_glib_network_monitor (libnm_glib_ctx *ctx, gpointer user_dat
int e_shell_nm_glib_initialise (EShellWindow *window )
{
- libnm_glib_ctx *ctx;
guint id;
- ctx = libnm_glib_init ();
- if (!ctx)
+ if (!nm_ctx)
{
- fprintf (stderr, "Could not initialize libnm.\n");
- return FALSE;
+ nm_ctx = libnm_glib_init ();
+ if (!nm_ctx) {
+ fprintf (stderr, "Could not initialize libnm.\n");
+ return FALSE;
+ }
}
- id = libnm_glib_register_callback (ctx, e_shell_glib_network_monitor, window, NULL);
+ id = libnm_glib_register_callback (nm_ctx, e_shell_glib_network_monitor, window, NULL);
return TRUE;
}