From bbfbdaf78143ca606557422769d723d1f373109b Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Sun, 1 Jul 2007 09:02:34 +0000 Subject: [PATCH] * modest-main.c: - return 0 iff there are no errors * modest-ui-actions: - clear the queue when closing down * modest-runtime.h: - remove unimplemented modest_runtime_init_ui * modest-tny-account-store: - debugging messages pmo-trunk-r2515 --- src/modest-main.c | 10 +++++++--- src/modest-runtime.h | 13 ------------- src/modest-tny-account-store.c | 3 ++- src/modest-ui-actions.c | 15 +++++++++++++-- 4 files changed, 22 insertions(+), 19 deletions(-) diff --git a/src/modest-main.c b/src/modest-main.c index 7ff8e9a..edf74b3 100644 --- a/src/modest-main.c +++ b/src/modest-main.c @@ -73,14 +73,18 @@ main (int argc, char *argv[]) g_object_unref (win); gtk_main (); - retval = 1; + retval = 0; cleanup: gdk_threads_leave (); - if (!modest_init_uninit ()) + if (!modest_init_uninit ()) { g_printerr ("modest: modest_init_uninit failed\n"); - + retval = 1; + } + + g_debug ("closing modest with retval %d", retval); + return retval; } diff --git a/src/modest-runtime.h b/src/modest-runtime.h index d84b43c..304739d 100644 --- a/src/modest-runtime.h +++ b/src/modest-runtime.h @@ -68,18 +68,6 @@ gboolean modest_runtime_init (void); /** - * modest_runtime_init_ui: - * @argc: the #argc argument to the main function - * @argv: the #argv argument to the main function - * - * initialize the modest UI; this replaces the call to - * gtk_init - * - * TRUE if this succeeded, FALSE otherwise. - */ -gboolean modest_runtime_init_ui (gint argc, gchar** argv); - -/** * modest_runtime_uinit: * * uninitialize the modest runtime system; free all the @@ -88,7 +76,6 @@ gboolean modest_runtime_init_ui (gint argc, gchar** argv); * TRUE if this succeeded, FALSE otherwise */ gboolean modest_runtime_uninit (void); - /** diff --git a/src/modest-tny-account-store.c b/src/modest-tny-account-store.c index d93da11..fd792c5 100644 --- a/src/modest-tny-account-store.c +++ b/src/modest-tny-account-store.c @@ -252,7 +252,6 @@ account_list_disconnect (GSList *accounts) { GSList *cursor = accounts; - g_printerr ("modest: DEBUG disconnecting all accounts\n"); while (cursor) { if (TNY_IS_CAMEL_ACCOUNT(cursor->data)) /* check twice... */ tny_camel_account_set_online (TNY_CAMEL_ACCOUNT(cursor->data), FALSE, NULL); @@ -563,7 +562,9 @@ modest_tny_account_store_finalize (GObject *obj) } /* disconnect all accounts when we are destroyed */ + g_debug ("modest: disconnecting all store accounts"); account_list_disconnect (priv->store_accounts); + g_debug ("modest: disconnecting all transport accounts"); account_list_disconnect (priv->transport_accounts); /* this includes the local folder */ diff --git a/src/modest-ui-actions.c b/src/modest-ui-actions.c index 012eea8..99c4c80 100644 --- a/src/modest-ui-actions.c +++ b/src/modest-ui-actions.c @@ -352,8 +352,19 @@ modest_ui_actions_on_quit (GtkAction *action, ModestWindow *win) modest_osso_save_state(); #endif /* MODEST_PLATFORM_MAEMO */ - /* FIXME: we need to cancel all actions/threads here, - so we really quit */ + g_debug ("closing down, clearing %d item(s) from operation queue", + modest_mail_operation_queue_num_elements + (modest_runtime_get_mail_operation_queue())); + + /* cancel all outstanding operations */ + modest_mail_operation_queue_cancel_all + (modest_runtime_get_mail_operation_queue()); + + g_debug ("queue has been cleared"); + + /* note: when modest-tny-account-store is finalized, + it will automatically set all network connections + to offline */ gtk_main_quit (); } -- 1.7.9.5