aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-accounts.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2002-11-15 07:26:55 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2002-11-15 07:26:55 +0800
commit4ff0a43cd48adc7cdc98be078cdfbc425aa7e8b0 (patch)
treedb724db4e864ce41a136ab6820559346c9cd9fe0 /mail/mail-accounts.c
parent334b42bda165b9cfd18f60f60742f850f9154c2e (diff)
downloadgsoc2013-evolution-4ff0a43cd48adc7cdc98be078cdfbc425aa7e8b0.tar.gz
gsoc2013-evolution-4ff0a43cd48adc7cdc98be078cdfbc425aa7e8b0.tar.zst
gsoc2013-evolution-4ff0a43cd48adc7cdc98be078cdfbc425aa7e8b0.zip
Use g_object_weak_ref rather than connecting to destroy.
2002-11-14 Jeffrey Stedfast <fejj@ximian.com> * mail-accounts.c (account_edit_clicked): Use g_object_weak_ref rather than connecting to destroy. (account_add_clicked): Same. * mail-callbacks.c (addrbook_sender): Make this use g_object_weak_notify also. (subscribe_dialog_destroy): Add NULL guards here since I think we really do want to connect to the "destroy" signal in the function that connects us to that signal. * mail-config-factory.c (config_control_factory_cb): Same. * mail-display.c (save_part): Here too. (make_popup_window): And here. * mail-send-recv.c (build_dialogue): Same here. * mail-summary.c (create_summary_view): Use g_object_weak_notify instead of connecting to the destroy signal. svn path=/trunk/; revision=18764
Diffstat (limited to 'mail/mail-accounts.c')
-rw-r--r--mail/mail-accounts.c27
1 files changed, 11 insertions, 16 deletions
diff --git a/mail/mail-accounts.c b/mail/mail-accounts.c
index f946ddc8f0..550017a543 100644
--- a/mail/mail-accounts.c
+++ b/mail/mail-accounts.c
@@ -121,20 +121,18 @@ mail_accounts_tab_finalise (GObject *obj)
}
static void
-account_add_finished (GtkWidget *widget, gpointer user_data)
+account_add_finished (MailAccountsTab *prefs, GObject *deadbeef)
{
/* Either Cancel or Finished was clicked in the druid so reload the accounts */
- MailAccountsTab *prefs = user_data;
-
prefs->druid = NULL;
-
+
#warning "GTK_OBJECT_DESTROYED"
#if 0
if (!GTK_OBJECT_DESTROYED (prefs))
#endif
mail_accounts_load (prefs);
- g_object_unref ((GtkObject *) prefs);
+ g_object_unref (prefs);
}
static void
@@ -144,29 +142,28 @@ account_add_clicked (GtkButton *button, gpointer user_data)
if (prefs->druid == NULL) {
prefs->druid = (GtkWidget *) mail_config_druid_new (prefs->shell);
- g_signal_connect((prefs->druid), "destroy",
- G_CALLBACK (account_add_finished), prefs);
+ g_object_weak_ref ((GObject *) prefs->druid,
+ (GWeakNotify) account_add_finished, prefs);
gtk_widget_show (prefs->druid);
- g_object_ref ((GtkObject *) prefs);
+ g_object_ref (prefs);
} else {
gdk_window_raise (prefs->druid->window);
}
}
static void
-account_edit_finished (GtkWidget *widget, gpointer user_data)
+account_edit_finished (MailAccountsTab *prefs, GObject *deadbeef)
{
- MailAccountsTab *prefs = user_data;
-
prefs->editor = NULL;
+#warning "GTK_OBJECT_DESTROYED"
#if 0
if (!GTK_OBJECT_DESTROYED (prefs))
#endif
mail_accounts_load (prefs);
- g_object_unref(prefs);
+ g_object_unref (prefs);
}
static void
@@ -193,11 +190,9 @@ account_edit_clicked (GtkButton *button, gpointer user_data)
account = gtk_clist_get_row_data (prefs->table, row);
#endif
prefs->editor = (GtkWidget *) mail_account_editor_new (account, GTK_WINDOW (window), prefs);
- g_signal_connect((prefs->editor), "destroy",
- G_CALLBACK (account_edit_finished),
- prefs);
+ g_object_weak_notify ((GObject *) prefs->editor, (GWeakNotify) account_edit_finished, prefs);
gtk_widget_show (prefs->editor);
- g_object_ref ((GtkObject *) prefs);
+ g_object_ref (prefs);
}
} else {
gdk_window_raise (prefs->editor->window);