2007-06-01 Murray Cumming <murrayc@murrayc.com>
authorMurray Cumming <murrayc@murrayc.com>
Fri, 1 Jun 2007 09:10:15 +0000 (09:10 +0000)
committerMurray Cumming <murrayc@murrayc.com>
Fri, 1 Jun 2007 09:10:15 +0000 (09:10 +0000)
* src/maemo/modest-maemo-global-settings-dialog.c:
        (current_connection): Check that we are even connected before trying to
        get the current connection name, to prevent a warning.

        * src/maemo/modest-platform.c: (modest_platform_connect_and_wait):
        Change the comments because tny_maemo_conic_device_connect() is now meant to
        block.
        * src/modest-mail-operation.c:
        (modest_mail_operation_update_account): Call modest_platform_connect_and_wait() to
        make sure we have a connection and fail if we can't connect.

pmo-trunk-r2025

ChangeLog2
src/maemo/modest-maemo-global-settings-dialog.c
src/maemo/modest-platform.c
src/modest-mail-operation.c

index 2b8ba9a..d0d06f7 100644 (file)
@@ -1,3 +1,16 @@
+2007-06-01  Murray Cumming  <murrayc@murrayc.com>
+
+       * src/maemo/modest-maemo-global-settings-dialog.c:
+       (current_connection): Check that we are even connected before trying to 
+       get the current connection name, to prevent a warning.
+       
+       * src/maemo/modest-platform.c: (modest_platform_connect_and_wait):
+       Change the comments because tny_maemo_conic_device_connect() is now meant to 
+       block.
+       * src/modest-mail-operation.c:
+       (modest_mail_operation_update_account): Call modest_platform_connect_and_wait() to 
+       make sure we have a connection and fail if we can't connect.
+
 2007-05-31  Murray Cumming  <murrayc@murrayc.com>
 
        * src/maemo/modest-main-window.c:
index d69567c..cae83cd 100644 (file)
@@ -391,6 +391,9 @@ current_connection (void)
        account_store = TNY_ACCOUNT_STORE (modest_runtime_get_account_store ());
        device = tny_account_store_get_device (account_store);
 
+       if (!tny_device_is_online (device))
+               return MODEST_CONNECTED_VIA_ANY;
+
        /* Get iap id */
        const gchar *iap_id = tny_maemo_conic_device_get_current_iap_id (TNY_MAEMO_CONIC_DEVICE (device));
        if (iap_id) {
index f3a66bb..11bc77a 100644 (file)
@@ -651,12 +651,8 @@ gboolean modest_platform_connect_and_wait (GtkWindow *parent_window)
        if (tny_device_is_online (device))
                return TRUE;
                
-       /* TODO: Block on the result: */
-       gboolean request_sent = tny_maemo_conic_device_connect (TNY_MAEMO_CONIC_DEVICE (device), NULL);
-       if (!request_sent)
-               return FALSE;
-
-       return TRUE;
+       /* This blocks on the result: */
+       return tny_maemo_conic_device_connect (TNY_MAEMO_CONIC_DEVICE (device), NULL);
 }
 
 void
index 2a627a7..f5dd0ac 100644 (file)
@@ -997,6 +997,13 @@ modest_mail_operation_update_account (ModestMailOperation *self,
        g_return_val_if_fail (MODEST_IS_MAIL_OPERATION (self), FALSE);
        g_return_val_if_fail (account_name, FALSE);
 
+       /* Make sure that we have a connection, and request one 
+        * if necessary:
+        * TODO: Is there some way to trigger this for every attempt to 
+        * use the network? */
+       if (!modest_platform_connect_and_wait(NULL))
+               return FALSE;
+       
        /* Init mail operation. Set total and done to 0, and do not
           update them, this way the progress objects will know that
           we have no clue about the number of the objects */