aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2006-07-27 17:42:18 +0800
committerBastien Nocera <hadess@src.gnome.org>2006-07-27 17:42:18 +0800
commitc6612c8d03bc4c1a45d92b5d94dce57fbb8d49a8 (patch)
tree936c9443326dbe91a0f9d65581da57e1eacc98e5
parent03f84f573a83c4faa2c326b46dd2a28759b470d6 (diff)
downloadgsoc2013-evolution-c6612c8d03bc4c1a45d92b5d94dce57fbb8d49a8.tar
gsoc2013-evolution-c6612c8d03bc4c1a45d92b5d94dce57fbb8d49a8.tar.gz
gsoc2013-evolution-c6612c8d03bc4c1a45d92b5d94dce57fbb8d49a8.tar.bz2
gsoc2013-evolution-c6612c8d03bc4c1a45d92b5d94dce57fbb8d49a8.tar.lz
gsoc2013-evolution-c6612c8d03bc4c1a45d92b5d94dce57fbb8d49a8.tar.xz
gsoc2013-evolution-c6612c8d03bc4c1a45d92b5d94dce57fbb8d49a8.tar.zst
gsoc2013-evolution-c6612c8d03bc4c1a45d92b5d94dce57fbb8d49a8.zip
Fix warnings at build-time, and clean up the connections to the D-Bus on
2006-07-27 Bastien Nocera <hadess@hadess.net> * e-shell-nm-glib.c: (e_shell_glib_network_monitor), (e_shell_nm_glib_initialise), (e_shell_nm_glib_dispose): * e-shell-nm.c: (e_shell_dbus_dispose): * e-shell-window.c: (impl_dispose): Fix warnings at build-time, and clean up the connections to the D-Bus on exit (Closes: #332387) svn path=/trunk/; revision=32425
-rw-r--r--shell/ChangeLog8
-rw-r--r--shell/e-shell-nm-glib.c21
-rw-r--r--shell/e-shell-nm.c8
-rw-r--r--shell/e-shell-window.c6
4 files changed, 35 insertions, 8 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog
index 76f19f5c33..790f20324a 100644
--- a/shell/ChangeLog
+++ b/shell/ChangeLog
@@ -1,3 +1,11 @@
+2006-07-27 Bastien Nocera <hadess@hadess.net>
+
+ * e-shell-nm-glib.c: (e_shell_glib_network_monitor),
+ (e_shell_nm_glib_initialise), (e_shell_nm_glib_dispose):
+ * e-shell-nm.c: (e_shell_dbus_dispose):
+ * e-shell-window.c: (impl_dispose): Fix warnings at build-time, and
+ clean up the connections to the D-Bus on exit (Closes: #332387)
+
2006-07-13 Srinivasa Ragavan <sragavan@novell.com>
** Fix for bug #345331
diff --git a/shell/e-shell-nm-glib.c b/shell/e-shell-nm-glib.c
index 9c6a8fd67d..994f3af755 100644
--- a/shell/e-shell-nm-glib.c
+++ b/shell/e-shell-nm-glib.c
@@ -31,6 +31,7 @@
#include <e-shell-window.h>
static libnm_glib_ctx *nm_ctx = NULL;
+static guint id = 0;
static void e_shell_glib_network_monitor (libnm_glib_ctx *ctx, gpointer user_data)
{
@@ -44,24 +45,19 @@ static void e_shell_glib_network_monitor (libnm_glib_ctx *ctx, gpointer user_dat
state = libnm_glib_get_network_state (ctx);
line_status = e_shell_get_line_status (shell);
-
+
if (line_status == E_SHELL_LINE_STATUS_ONLINE && state == LIBNM_NO_NETWORK_CONNECTION) {
shell_state = GNOME_Evolution_FORCED_OFFLINE;
e_shell_go_offline (shell, window, shell_state);
} else if (line_status == E_SHELL_LINE_STATUS_OFFLINE && state == LIBNM_ACTIVE_NETWORK_CONNECTION) {
shell_state = GNOME_Evolution_USER_ONLINE;
e_shell_go_online (shell, window, shell_state);
- } else
- return LIBNM_INVALID_CONTEXT;
-
- return FALSE;
+ }
}
int e_shell_nm_glib_initialise (EShellWindow *window )
{
- guint id;
-
if (!nm_ctx)
{
nm_ctx = libnm_glib_init ();
@@ -75,3 +71,14 @@ int e_shell_nm_glib_initialise (EShellWindow *window )
return TRUE;
}
+
+void e_shell_nm_glib_dispose (EShellWindow *window )
+{
+ if (id != 0 && nm_ctx != NULL) {
+ libnm_glib_unregister_callback (nm_ctx, id);
+ libnm_glib_shutdown (nm_ctx);
+ nm_ctx = NULL;
+ id = 0;
+ }
+}
+
diff --git a/shell/e-shell-nm.c b/shell/e-shell-nm.c
index f745dc9406..d8b62d861a 100644
--- a/shell/e-shell-nm.c
+++ b/shell/e-shell-nm.c
@@ -147,10 +147,16 @@ init_dbus (EShellWindow *window)
return FALSE;
}
-
int e_shell_dbus_initialise (EShellWindow *window)
{
g_type_init ();
return init_dbus (window);
}
+
+void e_shell_dbus_dispose (EShellWindow *window)
+{
+ //FIXME
+ return;
+}
+
diff --git a/shell/e-shell-window.c b/shell/e-shell-window.c
index bdf599906f..e5fc700ab0 100644
--- a/shell/e-shell-window.c
+++ b/shell/e-shell-window.c
@@ -844,6 +844,12 @@ impl_dispose (GObject *object)
priv->tooltips = NULL;
}
+ #ifdef NM_SUPPORT_GLIB
+ e_shell_nm_glib_dispose (E_SHELL_WINDOW (object));
+ #elif NM_SUPPORT
+ e_shell_dbus_dispose (E_SHELL_WINDOW (object));
+ #endif
+
(* G_OBJECT_CLASS (e_shell_window_parent_class)->dispose) (object);
}