X-Git-Url: http://git.maemo.org/git/?p=modest;a=blobdiff_plain;f=src%2Fmaemo%2Fmodest-platform.c;h=8ee664666011955386589d7254fac1bd1516053c;hp=5fe2b6897702dc3ed6a6495749211fb0b9af5c6d;hb=b48954c32882b59110f8f1926c04b9a391289c90;hpb=205a501871adaadb9c7d7c378328c9f5ece7331d diff --git a/src/maemo/modest-platform.c b/src/maemo/modest-platform.c index 5fe2b68..8ee6646 100644 --- a/src/maemo/modest-platform.c +++ b/src/maemo/modest-platform.c @@ -1181,39 +1181,6 @@ modest_platform_connect_and_wait_if_network_folderstore (GtkWindow *parent_windo return result; } -gboolean -modest_platform_is_network_folderstore (TnyFolderStore *folder_store) -{ - TnyAccount *account = NULL; - gboolean result = TRUE; - - g_return_val_if_fail(TNY_IS_FOLDER_STORE(folder_store), FALSE); - - if (TNY_IS_FOLDER (folder_store)) { - /* Get the folder's parent account: */ - account = tny_folder_get_account(TNY_FOLDER(folder_store)); - } else if (TNY_IS_ACCOUNT (folder_store)) { - account = TNY_ACCOUNT(folder_store); - g_object_ref(account); - } - - if (account != NULL) { - if (tny_account_get_account_type (account) == TNY_ACCOUNT_TYPE_STORE) { - if (!TNY_IS_CAMEL_POP_STORE_ACCOUNT (account) && - !TNY_IS_CAMEL_IMAP_STORE_ACCOUNT (account)) { - /* This must be a maildir account, which does - * not require a connection: */ - result = FALSE; - } - } - g_object_unref (account); - } else { - result = FALSE; - } - - return result; -} - void modest_platform_run_sort_dialog (GtkWindow *parent_window, ModestSortDialogType type) @@ -1990,43 +1957,16 @@ modest_platform_connect_and_perform (GtkWindow *parent_window, return; } - -void -modest_platform_connect_and_perform_if_network_account (GtkWindow *parent_window, - TnyAccount *account, - ModestConnectedPerformer callback, - gpointer user_data) -{ - if (tny_account_get_account_type (account) == TNY_ACCOUNT_TYPE_STORE) { - if (!TNY_IS_CAMEL_POP_STORE_ACCOUNT (account) && - !TNY_IS_CAMEL_IMAP_STORE_ACCOUNT (account)) { - - /* This IS a local account like a maildir account, which does not require - * a connection. (original comment had a vague assumption in its language - * usage. There's no assuming needed, this IS what it IS: a local account), */ - - /* We promise to instantly perform the callback, so ... */ - if (callback) { - callback (FALSE, NULL, parent_window, account, user_data); - } - - return; - } - } - - modest_platform_connect_and_perform (parent_window, account, callback, user_data); - - return; -} - + void -modest_platform_connect_and_perform_if_network_folderstore (GtkWindow *parent_window, +modest_platform_connect_if_remote_and_perform (GtkWindow *parent_window, TnyFolderStore *folder_store, ModestConnectedPerformer callback, gpointer user_data) { - if (!folder_store) { - + TnyAccount *account = NULL; + + if (!folder_store) { /* We promise to instantly perform the callback, so ... */ if (callback) { callback (FALSE, NULL, parent_window, NULL, user_data); @@ -2036,19 +1976,32 @@ modest_platform_connect_and_perform_if_network_folderstore (GtkWindow *parent_wi /* Original comment: Maybe it is something local. */ /* PVH's comment: maybe we should KNOW this in stead of assuming? */ - } - - if (TNY_IS_FOLDER (folder_store)) { + } else if (TNY_IS_FOLDER (folder_store)) { /* Get the folder's parent account: */ - TnyAccount *account = tny_folder_get_account(TNY_FOLDER (folder_store)); - if (account != NULL) { - modest_platform_connect_and_perform_if_network_account (NULL, account, callback, user_data); - g_object_unref (account); - } + account = tny_folder_get_account(TNY_FOLDER (folder_store)); } else if (TNY_IS_ACCOUNT (folder_store)) { /* Use the folder store as an account: */ - modest_platform_connect_and_perform_if_network_account (NULL, TNY_ACCOUNT (folder_store), callback, user_data); + account = TNY_ACCOUNT (folder_store); } + if (tny_account_get_account_type (account) == TNY_ACCOUNT_TYPE_STORE) { + if (!TNY_IS_CAMEL_POP_STORE_ACCOUNT (account) && + !TNY_IS_CAMEL_IMAP_STORE_ACCOUNT (account)) { + + /* This IS a local account like a maildir account, which does not require + * a connection. (original comment had a vague assumption in its language + * usage. There's no assuming needed, this IS what it IS: a local account), */ + + /* We promise to instantly perform the callback, so ... */ + if (callback) { + callback (FALSE, NULL, parent_window, account, user_data); + } + + return; + } + } + + modest_platform_connect_and_perform (parent_window, account, callback, user_data); + return; }