X-Git-Url: http://git.maemo.org/git/?p=modest;a=blobdiff_plain;f=src%2Fhildon2%2Fmodest-platform.c;h=41e5381b5ac946421be3074c5a2ce91dab716e3e;hp=3161437e042b832ce9aa78a82e0e1972ec3d93ff;hb=238ae1b0834f8400cfdbc99c139c245f4d8e9009;hpb=588b6c9779f0de4b0b63c685aa2b74efd1fb09df diff --git a/src/hildon2/modest-platform.c b/src/hildon2/modest-platform.c index 3161437..41e5381 100644 --- a/src/hildon2/modest-platform.c +++ b/src/hildon2/modest-platform.c @@ -692,7 +692,8 @@ folder_chooser_activated (ModestFolderView *folder_view, } static TnyFolderStore * -folder_chooser_dialog_run (ModestFolderView *original, TnyFolderStore *current) +folder_chooser_dialog_run (ModestFolderView *original, + TnyFolderStore *current) { GtkWidget *folder_view; FolderChooserData userdata = {NULL, NULL}; @@ -705,23 +706,32 @@ folder_chooser_dialog_run (ModestFolderView *original, TnyFolderStore *current) gtk_window_set_title (GTK_WINDOW (userdata.dialog), _FM("ckdg_ti_change_folder")); - modest_folder_view_copy_model (MODEST_FOLDER_VIEW (original), + modest_folder_view_copy_model (MODEST_FOLDER_VIEW (original), MODEST_FOLDER_VIEW (folder_view)); - if (TNY_IS_FOLDER_STORE (current)) { - if (TNY_IS_ACCOUNT (current)) { + if (TNY_IS_ACCOUNT (current)) { + /* Local folders and MMC account are always shown + along with the currently visible server account */ + if (modest_tny_account_is_virtual_local_folders (TNY_ACCOUNT (current)) || + modest_tny_account_is_memory_card_account (TNY_ACCOUNT (current))) + visible_id = + g_strdup (modest_folder_view_get_account_id_of_visible_server_account (MODEST_FOLDER_VIEW (original))); + else visible_id = g_strdup (tny_account_get_id (TNY_ACCOUNT (current))); - } else if (TNY_IS_FOLDER (current)) { - TnyAccount *account; - - account = tny_folder_get_account (TNY_FOLDER (current)); - if (account) { - visible_id = g_strdup (tny_account_get_id (TNY_ACCOUNT (current))); + } else if (TNY_IS_FOLDER (current)) { + TnyAccount *account; + account = tny_folder_get_account (TNY_FOLDER (current)); + if (account) { + if (modest_tny_account_is_virtual_local_folders (TNY_ACCOUNT (account)) || + modest_tny_account_is_memory_card_account (TNY_ACCOUNT (account))) { + visible_id = + g_strdup (modest_folder_view_get_account_id_of_visible_server_account (MODEST_FOLDER_VIEW (original))); + } else { + visible_id = g_strdup (tny_account_get_id (account)); } + g_object_unref (account); } - } - - if (visible_id == NULL) { + } else { visible_id = g_strdup ( modest_folder_view_get_account_id_of_visible_server_account (MODEST_FOLDER_VIEW(original))); } @@ -1134,14 +1144,16 @@ modest_platform_run_new_folder_dialog (GtkWindow *parent_window, suggested_folder); /* In hildon 2.2 we always suggest the archive folder as parent */ - acc_store = modest_runtime_get_account_store (); - account = modest_tny_account_store_get_mmc_folders_account (acc_store); - if (account) { - suggested_folder = (TnyFolderStore *) - modest_tny_account_get_special_folder (account, - TNY_FOLDER_TYPE_ARCHIVE); - g_object_unref (account); - account = NULL; + if (!suggested_folder) { + acc_store = modest_runtime_get_account_store (); + account = modest_tny_account_store_get_mmc_folders_account (acc_store); + if (account) { + suggested_folder = (TnyFolderStore *) + modest_tny_account_get_special_folder (account, + TNY_FOLDER_TYPE_ARCHIVE); + g_object_unref (account); + account = NULL; + } } /* If there is not archive folder then fallback to local folders account */