diff options
author | Matthew Barnes <mbarnes@src.gnome.org> | 2008-11-14 11:56:01 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@src.gnome.org> | 2008-11-14 11:56:01 +0800 |
commit | 8c0bd86d5fdd6d87c3170e2a01423e7c7018a981 (patch) | |
tree | 22da2df051cb6f1bc988d15aca08ebb0a5baf7e4 /mail/e-mail-shell-module.c | |
parent | 6760cc72334346b8654fcd9fe1440890db55ac1b (diff) | |
download | gsoc2013-evolution-8c0bd86d5fdd6d87c3170e2a01423e7c7018a981.tar gsoc2013-evolution-8c0bd86d5fdd6d87c3170e2a01423e7c7018a981.tar.gz gsoc2013-evolution-8c0bd86d5fdd6d87c3170e2a01423e7c7018a981.tar.bz2 gsoc2013-evolution-8c0bd86d5fdd6d87c3170e2a01423e7c7018a981.tar.lz gsoc2013-evolution-8c0bd86d5fdd6d87c3170e2a01423e7c7018a981.tar.xz gsoc2013-evolution-8c0bd86d5fdd6d87c3170e2a01423e7c7018a981.tar.zst gsoc2013-evolution-8c0bd86d5fdd6d87c3170e2a01423e7c7018a981.zip |
Rearranged some of the addressbook code to try and eliminate some circular
dependencies in our libraries. The circular dependency between the composer
and the mail module is still causing me headaches. And it doesn't help that
the addressbook and calendar also want to link to the composer.
svn path=/branches/kill-bonobo/; revision=36782
Diffstat (limited to 'mail/e-mail-shell-module.c')
-rw-r--r-- | mail/e-mail-shell-module.c | 35 |
1 files changed, 25 insertions, 10 deletions
diff --git a/mail/e-mail-shell-module.c b/mail/e-mail-shell-module.c index b7aa7a68c1..493cbfff63 100644 --- a/mail/e-mail-shell-module.c +++ b/mail/e-mail-shell-module.c @@ -459,21 +459,30 @@ mail_shell_module_init_preferences (void) } static gboolean -mail_shell_module_handle_uri (EShellModule *shell_module, - const gchar *uri) +mail_shell_module_handle_uri_cb (EShell *shell, + const gchar *uri, + EShellModule *shell_module) { /* FIXME */ return FALSE; } static void -mail_shell_module_window_created (EShellModule *shell_module, - EShellWindow *shell_window) +mail_shell_module_window_weak_notify_cb (EShell *shell, + GObject *where_the_object_was) +{ + g_signal_handlers_disconnect_by_func ( + shell, mail_shell_module_new_mail_cb, + where_the_object_was); +} + +static void +mail_shell_module_window_created_cb (EShell *shell, + EShellWindow *shell_window, + EShellModule *shell_module) { - EShell *shell; const gchar *module_name; - shell = e_shell_module_get_shell (shell_module); module_name = G_TYPE_MODULE (shell_module)->name; e_shell_window_register_new_item_actions ( @@ -487,6 +496,10 @@ mail_shell_module_window_created (EShellModule *shell_module, g_signal_connect_swapped ( shell, "event::new-mail", G_CALLBACK (mail_shell_module_new_mail_cb), shell_window); + + g_object_weak_ref ( + G_OBJECT (shell_window), (GWeakNotify) + mail_shell_module_window_weak_notify_cb, shell); } static EShellModuleInfo module_info = { @@ -532,13 +545,15 @@ e_shell_module_init (GTypeModule *type_module) folder_tree_model = em_folder_tree_model_new (shell_module); - g_signal_connect_swapped ( + g_signal_connect ( shell, "handle-uri", - G_CALLBACK (mail_shell_module_handle_uri), shell_module); + G_CALLBACK (mail_shell_module_handle_uri_cb), + shell_module); - g_signal_connect_swapped ( + g_signal_connect ( shell, "window-created", - G_CALLBACK (mail_shell_module_window_created), shell_module); + G_CALLBACK (mail_shell_module_window_created_cb), + shell_module); mail_config_init (); mail_msg_init (); |