* modest-main.c:
authorDirk-Jan C. Binnema <dirk-jan.binnema@nokia.com>
Sun, 1 Jul 2007 09:02:34 +0000 (09:02 +0000)
committerDirk-Jan C. Binnema <dirk-jan.binnema@nokia.com>
Sun, 1 Jul 2007 09:02:34 +0000 (09:02 +0000)
- 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
src/modest-runtime.h
src/modest-tny-account-store.c
src/modest-ui-actions.c

index 7ff8e9a..edf74b3 100644 (file)
@@ -73,14 +73,18 @@ main (int argc, char *argv[])
        g_object_unref (win);
        
        gtk_main ();    
        g_object_unref (win);
        
        gtk_main ();    
-       retval = 1;
+       retval = 0;
 
 cleanup:
        gdk_threads_leave ();
 
 
 cleanup:
        gdk_threads_leave ();
 
-       if (!modest_init_uninit ()) 
+       if (!modest_init_uninit ()) {
                g_printerr ("modest: modest_init_uninit failed\n");
                g_printerr ("modest: modest_init_uninit failed\n");
-       
+               retval = 1;
+       }
+
+       g_debug ("closing modest with retval %d", retval);
+
        return retval;
 }
 
        return retval;
 }
 
index d84b43c..304739d 100644 (file)
@@ -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
  * 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);
  * TRUE if this succeeded, FALSE otherwise
  */
 gboolean modest_runtime_uninit (void);
-
        
 
 /**
        
 
 /**
index d93da11..fd792c5 100644 (file)
@@ -252,7 +252,6 @@ account_list_disconnect (GSList *accounts)
 {
        GSList *cursor = 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);
        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 */
        }
 
        /* disconnect all accounts when we are destroyed */
+       g_debug ("modest: disconnecting all store accounts");
        account_list_disconnect (priv->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 */
        account_list_disconnect (priv->transport_accounts);
                
        /* this includes the local folder */
index 012eea8..99c4c80 100644 (file)
@@ -352,8 +352,19 @@ modest_ui_actions_on_quit (GtkAction *action, ModestWindow *win)
        modest_osso_save_state();
 #endif /* MODEST_PLATFORM_MAEMO */
 
        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 ();
 }
 
        gtk_main_quit ();
 }