diff options
author | JP Rosevear <jpr@ximian.com> | 2003-05-15 02:47:11 +0800 |
---|---|---|
committer | JP Rosevear <jpr@src.gnome.org> | 2003-05-15 02:47:11 +0800 |
commit | 946d755adc6d2d7c1163e2993293a099651b0af7 (patch) | |
tree | 5f4d8593e408e3becf0d8a79d34ab3e869c6d552 /mail | |
parent | 352d3c7d3b080850f4fc81b502a0f0b0d3c2369d (diff) | |
download | gsoc2013-evolution-946d755adc6d2d7c1163e2993293a099651b0af7.tar gsoc2013-evolution-946d755adc6d2d7c1163e2993293a099651b0af7.tar.gz gsoc2013-evolution-946d755adc6d2d7c1163e2993293a099651b0af7.tar.bz2 gsoc2013-evolution-946d755adc6d2d7c1163e2993293a099651b0af7.tar.lz gsoc2013-evolution-946d755adc6d2d7c1163e2993293a099651b0af7.tar.xz gsoc2013-evolution-946d755adc6d2d7c1163e2993293a099651b0af7.tar.zst gsoc2013-evolution-946d755adc6d2d7c1163e2993293a099651b0af7.zip |
add proto
2003-05-14 JP Rosevear <jpr@ximian.com>
* mail-local.h: add proto
* mail-local.c (storage_listener_startup): don't listen for
destruction, because we have a ref and it'll never happen
(mail_local_storage_shutdown): release and unref the local storage
* mail-display.c (retrieve_shell_view_interface_from_control):
return a new copy every time
(set_status_message): release and unref the shell view
* folder-browser.c (folder_browser_destroy): guard for multiple
destroys
* folder-browser-factory.c (control_activate): release and unref
the shell view
(control_destroy_cb): just remove the control from the list
(folder_browser_factory_new_control): don't weak ref the folder
browser
* component-factory.c (owner_unset_cb): shutdown local storage
svn path=/trunk/; revision=21181
Diffstat (limited to 'mail')
-rw-r--r-- | mail/ChangeLog | 23 | ||||
-rw-r--r-- | mail/component-factory.c | 1 | ||||
-rw-r--r-- | mail/folder-browser-factory.c | 33 | ||||
-rw-r--r-- | mail/folder-browser.c | 7 | ||||
-rw-r--r-- | mail/mail-display.c | 19 | ||||
-rw-r--r-- | mail/mail-local.c | 24 | ||||
-rw-r--r-- | mail/mail-local.h | 1 |
7 files changed, 51 insertions, 57 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index a7e1a285dc..97826c5cd7 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,26 @@ +2003-05-14 JP Rosevear <jpr@ximian.com> + + * mail-local.h: add proto + + * mail-local.c (storage_listener_startup): don't listen for + destruction, because we have a ref and it'll never happen + (mail_local_storage_shutdown): release and unref the local storage + + * mail-display.c (retrieve_shell_view_interface_from_control): + return a new copy every time + (set_status_message): release and unref the shell view + + * folder-browser.c (folder_browser_destroy): guard for multiple + destroys + + * folder-browser-factory.c (control_activate): release and unref + the shell view + (control_destroy_cb): just remove the control from the list + (folder_browser_factory_new_control): don't weak ref the folder + browser + + * component-factory.c (owner_unset_cb): shutdown local storage + 2003-05-13 Ettore Perazzoli <ettore@ximian.com> * component-factory.c (segv_redirect): Removed. diff --git a/mail/component-factory.c b/mail/component-factory.c index b2bc053cad..5968d97069 100644 --- a/mail/component-factory.c +++ b/mail/component-factory.c @@ -925,6 +925,7 @@ owner_unset_cb (EvolutionShellComponent *shell_component, gpointer user_data) empty_trash (NULL, NULL, NULL); unref_standard_folders (); + mail_local_storage_shutdown (); mail_importer_uninit (); global_shell_client = NULL; diff --git a/mail/folder-browser-factory.c b/mail/folder-browser-factory.c index 9f35b88db8..35e1aeb2ab 100644 --- a/mail/folder-browser-factory.c +++ b/mail/folder-browser-factory.c @@ -91,6 +91,7 @@ control_activate (BonoboControl *control, { GtkWidget *folder_browser; Bonobo_UIContainer container; + GNOME_Evolution_ShellView svi; container = bonobo_control_get_remote_ui_container (control, NULL); bonobo_ui_component_set_container (uic, container, NULL); @@ -110,7 +111,9 @@ control_activate (BonoboControl *control, /*bonobo_ui_component_thaw (uic, NULL);*/ - folder_browser_set_shell_view (fb, fb_get_svi (control)); + svi = fb_get_svi (control); + folder_browser_set_shell_view (fb, svi); + bonobo_object_release_unref (svi, NULL); folder_browser_reload (fb); @@ -158,32 +161,9 @@ control_activate_cb (BonoboControl *control, } static void -control_destroy_cb (GtkObject *fb, GObject *deadbeef) +control_destroy_cb (GtkObject *fb, GObject *control) { - gtk_object_destroy (fb); -} - -static void -browser_destroy_cb (BonoboControl *control, GObject *deadbeef) -{ - EIterator *it; - - /* We do this from browser_destroy_cb rather than - * control_destroy_cb because currently, the controls - * don't seem to all get destroyed properly at quit - * time (but the widgets get destroyed by X). FIXME. - */ - - it = e_list_get_iterator (control_list); - while (e_iterator_is_valid (it)) { - if (e_iterator_get (it) == control) { - e_iterator_delete (it); - break; - } - e_iterator_next (it); - } - - g_object_unref (it); + e_list_remove (control_list, control); } BonoboControl * @@ -210,7 +190,6 @@ folder_browser_factory_new_control (const char *uri, g_signal_connect (control, "activate", G_CALLBACK (control_activate_cb), fb); g_object_weak_ref (G_OBJECT(control), (GWeakNotify) control_destroy_cb, fb); - g_object_weak_ref (G_OBJECT(fb), (GWeakNotify) browser_destroy_cb, control); if (!control_list) control_list = e_list_new (NULL, NULL, NULL); diff --git a/mail/folder-browser.c b/mail/folder-browser.c index d70ea2c47e..3c11954b45 100644 --- a/mail/folder-browser.c +++ b/mail/folder-browser.c @@ -199,8 +199,11 @@ folder_browser_destroy (GtkObject *object) } /* wait for all outstanding async events against us */ - mail_async_event_destroy (folder_browser->async_event); - + if (folder_browser->async_event) { + mail_async_event_destroy (folder_browser->async_event); + folder_browser->async_event = NULL; + } + if (folder_browser->search_full) { g_object_unref (folder_browser->search_full); folder_browser->search_full = NULL; diff --git a/mail/mail-display.c b/mail/mail-display.c index bf8bc41c47..79f0aea10d 100644 --- a/mail/mail-display.c +++ b/mail/mail-display.c @@ -44,6 +44,7 @@ #include <libgnomevfs/gnome-vfs-mime-handlers.h> #include <libgnomevfs/gnome-vfs.h> #include <libgnome/gnome-url.h> +#include <bonobo/bonobo-exception.h> #include <bonobo/bonobo-control-frame.h> #include <bonobo/bonobo-stream-memory.h> #include <bonobo/bonobo-widget.h> @@ -2570,14 +2571,11 @@ retrieve_shell_view_interface_from_control (BonoboControl *control) shell_view_interface = Bonobo_Unknown_queryInterface (control_frame, "IDL:GNOME/Evolution/ShellView:1.0", &ev); - CORBA_exception_free (&ev); + + if (BONOBO_EX (&ev)) + shell_view_interface = CORBA_OBJECT_NIL; - if (shell_view_interface != CORBA_OBJECT_NIL) - g_object_set_data ((GObject *) control, - "mail_threads_shell_view_interface", - shell_view_interface); - else - g_warning ("Control frame doesn't have Evolution/ShellView."); + CORBA_exception_free (&ev); return shell_view_interface; } @@ -2596,10 +2594,7 @@ set_status_message (const char *message, int busy) control = BONOBO_CONTROL (e_iterator_get (it)); - shell_view_interface = g_object_get_data ((GObject *) control, "mail_threads_shell_view_interface"); - - if (shell_view_interface == CORBA_OBJECT_NIL) - shell_view_interface = retrieve_shell_view_interface_from_control (control); + shell_view_interface = retrieve_shell_view_interface_from_control (control); CORBA_exception_init (&ev); @@ -2612,6 +2607,8 @@ set_status_message (const char *message, int busy) } CORBA_exception_free (&ev); + + bonobo_object_release_unref (shell_view_interface, NULL); /* yeah we only set the first one. Why? Because it seems to leave random ones lying around otherwise. Shrug. */ diff --git a/mail/mail-local.c b/mail/mail-local.c index cbec89d89e..bf0271afb9 100644 --- a/mail/mail-local.c +++ b/mail/mail-local.c @@ -1143,18 +1143,6 @@ mail_local_provider_init (void) /* ** Local Storage Listener ****************************************************** */ static void -local_storage_destroyed_cb (EvolutionStorageListener *storage_listener, - void *data) -{ - CORBA_Environment ev; - - CORBA_exception_init (&ev); - bonobo_object_release_unref (data, &ev); - CORBA_exception_free (&ev); -} - - -static void local_storage_new_folder_cb (EvolutionStorageListener *storage_listener, const char *path, const GNOME_Evolution_Folder *folder, @@ -1232,11 +1220,6 @@ storage_listener_startup (EvolutionShellClient *shellclient) corba_local_storage_listener = evolution_storage_listener_corba_objref ( local_storage_listener); - /* FIXME: is this supposed to be destroy? */ - g_signal_connect(local_storage_listener, - "destroyed", - G_CALLBACK (local_storage_destroyed_cb), - corba_storage); g_signal_connect(local_storage_listener, "new_folder", G_CALLBACK (local_storage_new_folder_cb), @@ -1274,6 +1257,13 @@ mail_local_storage_startup (EvolutionShellClient *shellclient, const char *evolu storage_listener_startup (shellclient); } +void +mail_local_storage_shutdown (void) +{ + bonobo_object_release_unref (local_corba_storage, NULL); + local_corba_storage = CORBA_OBJECT_NIL; +} + /*---------------------------------------------------------------------- * Local folder reconfiguration stuff diff --git a/mail/mail-local.h b/mail/mail-local.h index d75356609c..f9acd09475 100644 --- a/mail/mail-local.h +++ b/mail/mail-local.h @@ -30,6 +30,7 @@ #include <camel/camel-folder.h> void mail_local_storage_startup (EvolutionShellClient *shellclient, const char *evolution_path); +void mail_local_storage_shutdown (void); void mail_local_reconfigure_folder(const char *uri, void (*done)(const char *uri, CamelFolder *folder, void *data), void *done_data); |