diff options
author | Not Zed <NotZed@Ximian.com> | 2002-11-18 19:19:30 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2002-11-18 19:19:30 +0800 |
commit | dbcfcb84f39fa67899eb9b8291e0c1f02aca3115 (patch) | |
tree | e6eb96ef3f09beb76c01356d6fda6ed47412d713 | |
parent | 608dc6cd2ced6625b98c7245ec8f52084d257f8a (diff) | |
download | gsoc2013-evolution-dbcfcb84f39fa67899eb9b8291e0c1f02aca3115.tar gsoc2013-evolution-dbcfcb84f39fa67899eb9b8291e0c1f02aca3115.tar.gz gsoc2013-evolution-dbcfcb84f39fa67899eb9b8291e0c1f02aca3115.tar.bz2 gsoc2013-evolution-dbcfcb84f39fa67899eb9b8291e0c1f02aca3115.tar.lz gsoc2013-evolution-dbcfcb84f39fa67899eb9b8291e0c1f02aca3115.tar.xz gsoc2013-evolution-dbcfcb84f39fa67899eb9b8291e0c1f02aca3115.tar.zst gsoc2013-evolution-dbcfcb84f39fa67899eb9b8291e0c1f02aca3115.zip |
Remove check for gtk_main_level(). as far as i can tell it serves no real
2002-11-18 Not Zed <NotZed@Ximian.com>
* e-msg-composer.c (create_composer): Remove check for
gtk_main_level(). as far as i can tell it serves no real purpose,
and i think gtkmain is now redundant.
(e_msg_composer_new_with_message): Same here.
(destroy): moved some stuff into finalise, and made destroy
mulitcall safe.
svn path=/trunk/; revision=18819
-rw-r--r-- | composer/ChangeLog | 9 | ||||
-rw-r--r-- | composer/e-msg-composer.c | 80 |
2 files changed, 53 insertions, 36 deletions
diff --git a/composer/ChangeLog b/composer/ChangeLog index 467775cffe..a05743485f 100644 --- a/composer/ChangeLog +++ b/composer/ChangeLog @@ -1,3 +1,12 @@ +2002-11-18 Not Zed <NotZed@Ximian.com> + + * e-msg-composer.c (create_composer): Remove check for + gtk_main_level(). as far as i can tell it serves no real purpose, + and i think gtkmain is now redundant. + (e_msg_composer_new_with_message): Same here. + (destroy): moved some stuff into finalise, and made destroy + mulitcall safe. + 2002-11-13 Ettore Perazzoli <ettore@ximian.com> * listener.h: Removed {BEGIN,END}_GNOME_DECLS. diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c index 22cc845e4b..17dd1fb466 100644 --- a/composer/e-msg-composer.c +++ b/composer/e-msg-composer.c @@ -2314,6 +2314,34 @@ from_changed_cb (EMsgComposerHdrs *hdrs, void *data) static void composer_finalise (GObject *object) { + EMsgComposer *composer; + + composer = E_MSG_COMPOSER (object); + + mail_config_signature_unregister_client ((MailConfigSignatureClient) sig_event_client, composer); + + if (composer->extra_hdr_names) { + int i; + + for (i = 0; i < composer->extra_hdr_names->len; i++) { + g_free (composer->extra_hdr_names->pdata[i]); + g_free (composer->extra_hdr_values->pdata[i]); + } + g_ptr_array_free (composer->extra_hdr_names, TRUE); + g_ptr_array_free (composer->extra_hdr_values, TRUE); + } + + e_msg_composer_clear_inlined_table (composer); + g_hash_table_destroy (composer->inline_images); + g_hash_table_destroy (composer->inline_images_by_url); + + g_free (composer->charset); + g_free (composer->mime_type); + g_free (composer->mime_body); + + if (composer->redirect) + camel_object_unref (CAMEL_OBJECT (composer->redirect)); + /* When destroy() is called, the contents of the window * (including the remote editor control) will already have * been destroyed, so we have to do this here. @@ -2330,72 +2358,56 @@ destroy (GtkObject *object) CORBA_Environment ev; composer = E_MSG_COMPOSER (object); - - mail_config_signature_unregister_client ((MailConfigSignatureClient) sig_event_client, composer); - + CORBA_exception_init (&ev); if (composer->config_db) { Bonobo_ConfigDatabase_sync (composer->config_db, &ev); bonobo_object_release_unref (composer->config_db, NULL); + composer->config_db = NULL; } - composer->config_db = NULL; - if (composer->uic) + if (composer->uic) { bonobo_object_unref (BONOBO_OBJECT (composer->uic)); - composer->uic = NULL; + composer->uic = NULL; + } /* FIXME? I assume the Bonobo widget will get destroyed normally? */ - if (composer->address_dialog != NULL) + if (composer->address_dialog != NULL) { gtk_widget_destroy (composer->address_dialog); - if (composer->hdrs != NULL) + composer->address_dialog = NULL; + } + if (composer->hdrs != NULL) { gtk_widget_destroy (composer->hdrs); - - if (composer->extra_hdr_names) { - int i; - - for (i = 0; i < composer->extra_hdr_names->len; i++) { - g_free (composer->extra_hdr_names->pdata[i]); - g_free (composer->extra_hdr_values->pdata[i]); - } - g_ptr_array_free (composer->extra_hdr_names, TRUE); - g_ptr_array_free (composer->extra_hdr_values, TRUE); + composer->hdrs = NULL; } - e_msg_composer_clear_inlined_table (composer); - g_hash_table_destroy (composer->inline_images); - g_hash_table_destroy (composer->inline_images_by_url); - - g_free (composer->charset); - g_free (composer->mime_type); - g_free (composer->mime_body); - - CORBA_exception_init (&ev); - if (composer->persist_stream_interface != CORBA_OBJECT_NIL) { Bonobo_Unknown_unref (composer->persist_stream_interface, &ev); CORBA_Object_release (composer->persist_stream_interface, &ev); + composer->persist_stream_interface = CORBA_OBJECT_NIL; } if (composer->persist_file_interface != CORBA_OBJECT_NIL) { Bonobo_Unknown_unref (composer->persist_file_interface, &ev); CORBA_Object_release (composer->persist_file_interface, &ev); + composer->persist_file_interface = CORBA_OBJECT_NIL; } if (composer->editor_engine != CORBA_OBJECT_NIL) { Bonobo_Unknown_unref (composer->editor_engine, &ev); CORBA_Object_release (composer->editor_engine, &ev); + composer->editor_engine = CORBA_OBJECT_NIL; } CORBA_exception_free (&ev); - if (composer->redirect) - camel_object_unref (CAMEL_OBJECT (composer->redirect)); - - if (composer->editor_listener) + if (composer->editor_listener) { bonobo_object_unref (composer->editor_listener); + composer->editor_listener = NULL; + } if (GTK_OBJECT_CLASS (parent_class)->destroy != NULL) (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); @@ -2761,8 +2773,6 @@ create_composer (int visible_mask) CORBA_Environment ev; int vis; - g_return_val_if_fail (gtk_main_level () > 0, NULL); - #warning " does win_name need qualifying? " composer = g_object_new (E_TYPE_MSG_COMPOSER, "win_name", _("Compose a message"), NULL); @@ -3385,8 +3395,6 @@ e_msg_composer_new_with_message (CamelMimeMessage *message) XEvolution *xev; int len, i; - g_return_val_if_fail (gtk_main_level () > 0, NULL); - postto = camel_medium_get_header (CAMEL_MEDIUM (message), "X-Evolution-PostTo"); new = create_composer (postto ? E_MSG_COMPOSER_VISIBLE_MASK_POST : E_MSG_COMPOSER_VISIBLE_MASK_MAIL); |