diff options
author | Shreyas Srinivasan <sshreyas@novell.com> | 2006-02-05 12:42:45 +0800 |
---|---|---|
committer | Shreyas Srinivasan <shres@src.gnome.org> | 2006-02-05 12:42:45 +0800 |
commit | 026358880f1ef99df8b99c4b9430031d66d3648e (patch) | |
tree | df055cc9667f7c4c22b353cff25dec23a678f994 /shell/e-shell-nm-glib.c | |
parent | 17db214c431ffe74c1efe64671e34892ce833356 (diff) | |
download | gsoc2013-evolution-026358880f1ef99df8b99c4b9430031d66d3648e.tar.gz gsoc2013-evolution-026358880f1ef99df8b99c4b9430031d66d3648e.tar.zst gsoc2013-evolution-026358880f1ef99df8b99c4b9430031d66d3648e.zip |
init the nm-dbus connection once.
2006-02-05 Shreyas Srinivasan <sshreyas@novell.com>
* e-shell-nm-glib.c: init the nm-dbus connection once.
svn path=/trunk/; revision=31406
Diffstat (limited to 'shell/e-shell-nm-glib.c')
-rw-r--r-- | shell/e-shell-nm-glib.c | 14 |
1 files changed, 8 insertions, 6 deletions
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; } |