From 026358880f1ef99df8b99c4b9430031d66d3648e Mon Sep 17 00:00:00 2001 From: Shreyas Srinivasan Date: Sun, 5 Feb 2006 04:42:45 +0000 Subject: init the nm-dbus connection once. 2006-02-05 Shreyas Srinivasan * e-shell-nm-glib.c: init the nm-dbus connection once. svn path=/trunk/; revision=31406 --- shell/ChangeLog | 4 ++++ shell/e-shell-nm-glib.c | 14 ++++++++------ 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 + + * e-shell-nm-glib.c: init the nm-dbus connection once. + 2006-01-29 Kjartan Maraas * 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 #include +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; } -- cgit v1.2.3