aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2002-11-26 14:43:31 +0800
committerMichael Zucci <zucchi@src.gnome.org>2002-11-26 14:43:31 +0800
commit989e19963822b5dc48d0074f876a29c695f63158 (patch)
tree872a102e427cac6af166237bb9dd763384082743 /mail
parent66442571c9fa464dae8b5f0eada5501183cc6656 (diff)
downloadgsoc2013-evolution-989e19963822b5dc48d0074f876a29c695f63158.tar.gz
gsoc2013-evolution-989e19963822b5dc48d0074f876a29c695f63158.tar.zst
gsoc2013-evolution-989e19963822b5dc48d0074f876a29c695f63158.zip
gtk_widget_set_parent_window -> gtk_window_set_transient_for.
2002-11-26 Not Zed <NotZed@Ximian.com> * mail-account-editor.c (mail_account_editor_new): gtk_widget_set_parent_window -> gtk_window_set_transient_for. * mail-callbacks.c (composer_send_queued_cb): dont unref composer. * message-browser.c (message_browser_destroy): moved back from finalise. 2002-11-25 Not Zed <NotZed@Ximian.com> * message-list.c (message_list_dispose): move saving tree state here. (message_list_finalise): And take it from here. * mail-display.c (mail_display_destroy): @#$@# gtk. changed this around a bit. (mail_display_init): Fix prototype, its a gobject. (mail_display_init): ref/sink the invisible gtkobject. svn path=/trunk/; revision=18919
Diffstat (limited to 'mail')
-rw-r--r--mail/ChangeLog21
-rw-r--r--mail/mail-account-editor.c2
-rw-r--r--mail/mail-callbacks.c1
-rw-r--r--mail/mail-display.c54
-rw-r--r--mail/message-browser.c15
-rw-r--r--mail/message-list.c17
6 files changed, 78 insertions, 32 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index bed571fc0d..88d87be4ce 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,24 @@
+2002-11-26 Not Zed <NotZed@Ximian.com>
+
+ * mail-account-editor.c (mail_account_editor_new):
+ gtk_widget_set_parent_window -> gtk_window_set_transient_for.
+
+ * mail-callbacks.c (composer_send_queued_cb): dont unref composer.
+
+ * message-browser.c (message_browser_destroy): moved back from
+ finalise.
+
+2002-11-25 Not Zed <NotZed@Ximian.com>
+
+ * message-list.c (message_list_dispose): move saving tree state
+ here.
+ (message_list_finalise): And take it from here.
+
+ * mail-display.c (mail_display_destroy): @#$@# gtk. changed this
+ around a bit.
+ (mail_display_init): Fix prototype, its a gobject.
+ (mail_display_init): ref/sink the invisible gtkobject.
+
2002-11-22 Not Zed <NotZed@Ximian.com>
* mail-callbacks.c (ask_confirm_for_unwanted_html_mail): removed
diff --git a/mail/mail-account-editor.c b/mail/mail-account-editor.c
index 751c95519b..feb7384bcb 100644
--- a/mail/mail-account-editor.c
+++ b/mail/mail-account-editor.c
@@ -168,7 +168,7 @@ mail_account_editor_new (MailConfigAccount *account, GtkWindow *parent, MailAcco
MailAccountEditor *new;
new = (MailAccountEditor *) g_object_new(mail_account_editor_get_type (), NULL);
- gtk_widget_set_parent_window ((GtkWidget *) new, ((GtkWidget *)parent)->window);
+ gtk_window_set_transient_for ((GtkWindow *) new, parent);
construct (new, account, dialog);
return new;
diff --git a/mail/mail-callbacks.c b/mail/mail-callbacks.c
index 7b2578c1b8..7183bcf017 100644
--- a/mail/mail-callbacks.c
+++ b/mail/mail-callbacks.c
@@ -397,7 +397,6 @@ composer_send_queued_cb (CamelFolder *folder, CamelMimeMessage *msg, CamelMessag
e_msg_composer_set_enable_autosave (send->composer, TRUE);
gtk_widget_show (GTK_WIDGET (send->composer));
- g_object_unref (send->composer);
}
camel_message_info_free (info);
diff --git a/mail/mail-display.c b/mail/mail-display.c
index 559a3c92dc..d5c7a6b0fd 100644
--- a/mail/mail-display.c
+++ b/mail/mail-display.c
@@ -1917,7 +1917,7 @@ mail_display_load_images (MailDisplay *md)
*----------------------------------------------------------------------*/
static void
-mail_display_init (GtkObject *object)
+mail_display_init (GObject *object)
{
MailDisplay *mail_display = MAIL_DISPLAY (object);
@@ -1934,6 +1934,8 @@ mail_display_init (GtkObject *object)
mail_display->data = NULL;
mail_display->invisible = gtk_invisible_new ();
+ g_object_ref(mail_display->invisible);
+ gtk_object_sink((GtkObject *)mail_display->invisible);
mail_display->display_style = mail_config_get_message_display_style ();
@@ -1952,33 +1954,43 @@ mail_display_destroy (GtkObject *object)
if (mail_display->html) {
g_object_unref(mail_display->html);
mail_display->html = NULL;
+ }
- if (mail_display->current_message) {
- camel_object_unref (mail_display->current_message);
- g_datalist_clear (mail_display->data);
- fetch_cancel(mail_display);
- }
+ if (mail_display->current_message) {
+ camel_object_unref (mail_display->current_message);
+ g_datalist_clear (mail_display->data);
+ fetch_cancel(mail_display);
+ mail_display->current_message = NULL;
+ }
- g_free (mail_display->charset);
- g_free (mail_display->selection);
+ g_free (mail_display->charset);
+ mail_display->charset = NULL;
+ g_free (mail_display->selection);
+ mail_display->selection = NULL;
+
+ if (mail_display->folder) {
+ if (mail_display->info)
+ camel_folder_free_message_info (mail_display->folder, mail_display->info);
+ camel_object_unref (mail_display->folder);
+ mail_display->folder = NULL;
+ }
- if (mail_display->folder) {
- if (mail_display->info)
- camel_folder_free_message_info (mail_display->folder, mail_display->info);
- camel_object_unref (mail_display->folder);
- }
+ g_free (mail_display->data);
+ mail_display->data = NULL;
- g_free (mail_display->data);
- mail_display->data = NULL;
-
- if (mail_display->idle_id)
- gtk_timeout_remove (mail_display->idle_id);
-
- g_object_unref (mail_display->invisible);
+ if (mail_display->idle_id) {
+ gtk_timeout_remove (mail_display->idle_id);
+ mail_display->idle_id = 0;
+ }
- g_free(mail_display->priv);
+ if (mail_display->invisible) {
+ g_object_unref (mail_display->invisible);
+ mail_display->invisible = NULL;
}
+ g_free(mail_display->priv);
+ mail_display->priv = NULL;
+
mail_display_parent_class->destroy (object);
}
diff --git a/mail/message-browser.c b/mail/message-browser.c
index 592d436e35..7ecdbdd997 100644
--- a/mail/message-browser.c
+++ b/mail/message-browser.c
@@ -61,23 +61,26 @@ static GtkAllocation last_allocation = { 0, 0 };
static BonoboWindowClass *message_browser_parent_class;
static void
-message_browser_finalise (GObject *object)
+message_browser_destroy (GtkObject *object)
{
MessageBrowser *message_browser;
message_browser = MESSAGE_BROWSER (object);
- g_signal_handlers_disconnect_matched(message_browser->fb, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, message_browser);
- g_object_unref((message_browser->fb));
+ if (message_browser->fb) {
+ g_signal_handlers_disconnect_matched(message_browser->fb, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, message_browser);
+ g_object_unref((message_browser->fb));
+ message_browser->fb = NULL;
+ }
- if (G_OBJECT_CLASS (message_browser_parent_class)->finalize)
- (G_OBJECT_CLASS (message_browser_parent_class)->finalize) (object);
+ if (GTK_OBJECT_CLASS (message_browser_parent_class)->destroy)
+ (GTK_OBJECT_CLASS (message_browser_parent_class)->destroy) (object);
}
static void
message_browser_class_init (GObjectClass *object_class)
{
- object_class->finalize = message_browser_finalise;
+ ((GtkObjectClass *)object_class)->destroy = message_browser_destroy;
message_browser_parent_class = g_type_class_ref(PARENT_TYPE);
}
diff --git a/mail/message-list.c b/mail/message-list.c
index 810253bd4e..24139fa9c1 100644
--- a/mail/message-list.c
+++ b/mail/message-list.c
@@ -1261,6 +1261,19 @@ normalised_free (gpointer key, gpointer value, gpointer user_data)
}
static void
+message_list_dispose(GObject *object)
+{
+ MessageList *message_list = MESSAGE_LIST (object);
+
+ if (message_list->folder) {
+ save_tree_state(message_list);
+ hide_save_state(message_list);
+ }
+
+ G_OBJECT_CLASS (message_list_parent_class)->dispose(object);
+}
+
+static void
message_list_finalise (GObject *object)
{
MessageList *message_list = MESSAGE_LIST (object);
@@ -1271,9 +1284,6 @@ message_list_finalise (GObject *object)
g_hash_table_destroy (message_list->normalised_hash);
if (message_list->folder) {
- save_tree_state(message_list);
- hide_save_state(message_list);
-
camel_object_unhook_event(message_list->folder, "folder_changed", folder_changed, message_list);
camel_object_unhook_event(message_list->folder, "message_changed", message_changed, message_list);
camel_object_unref (message_list->folder);
@@ -1321,6 +1331,7 @@ message_list_class_init (GObjectClass *object_class)
message_list_parent_class = g_type_class_ref(PARENT_TYPE);
object_class->finalize = message_list_finalise;
+ object_class->dispose = message_list_dispose;
message_list_signals[MESSAGE_SELECTED] =
g_signal_new ("message_selected",