From: Murray Cumming Date: Fri, 1 Jun 2007 09:10:15 +0000 (+0000) Subject: 2007-06-01 Murray Cumming X-Git-Tag: git_migration_finished~3462 X-Git-Url: http://git.maemo.org/git/?p=modest;a=commitdiff_plain;h=f9f685750fedb032086044c6d7cee9c4a5d99d90 2007-06-01 Murray Cumming * 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 --- diff --git a/ChangeLog2 b/ChangeLog2 index 2b8ba9a..d0d06f7 100644 --- a/ChangeLog2 +++ b/ChangeLog2 @@ -1,3 +1,16 @@ +2007-06-01 Murray Cumming + + * 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 * src/maemo/modest-main-window.c: diff --git a/src/maemo/modest-maemo-global-settings-dialog.c b/src/maemo/modest-maemo-global-settings-dialog.c index d69567c..cae83cd 100644 --- a/src/maemo/modest-maemo-global-settings-dialog.c +++ b/src/maemo/modest-maemo-global-settings-dialog.c @@ -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) { diff --git a/src/maemo/modest-platform.c b/src/maemo/modest-platform.c index f3a66bb..11bc77a 100644 --- a/src/maemo/modest-platform.c +++ b/src/maemo/modest-platform.c @@ -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 diff --git a/src/modest-mail-operation.c b/src/modest-mail-operation.c index 2a627a7..f5dd0ac 100644 --- a/src/modest-mail-operation.c +++ b/src/modest-mail-operation.c @@ -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 */