X-Git-Url: http://git.maemo.org/git/?p=modest;a=blobdiff_plain;f=src%2Fmaemo%2Fmodest-platform.c;h=44271d5a95cd48f13df19f99e57703608c0a9cbf;hp=f325631c93a411c17495ea8b34e523ed24b052cd;hb=f82ebf3c3924cf7030e44436f0ab16bf042ed938;hpb=b24a894146f3c70d89de221dfb9c2d5b2ba99188 diff --git a/src/maemo/modest-platform.c b/src/maemo/modest-platform.c index f325631..44271d5 100644 --- a/src/maemo/modest-platform.c +++ b/src/maemo/modest-platform.c @@ -2144,6 +2144,44 @@ modest_platform_connect_if_remote_and_perform (GtkWindow *parent_window, return; } +static void +src_account_connect_performer (gboolean canceled, + GError *err, + GtkWindow *parent_window, + TnyAccount *src_account, + gpointer user_data) +{ + DoubleConnectionInfo *info = (DoubleConnectionInfo *) user_data; + + if (canceled || err) { + /* If there was any error call the user callback */ + info->callback (canceled, err, parent_window, src_account, info->data); + } else { + /* Connect the destination account */ + modest_platform_connect_if_remote_and_perform (parent_window, TRUE, + TNY_FOLDER_STORE (info->dst_account), + info->callback, info->data); + } + + /* Free the info object */ + g_object_unref (info->dst_account); + g_slice_free (DoubleConnectionInfo, info); +} + + +void +modest_platform_double_connect_and_perform (GtkWindow *parent_window, + gboolean force, + TnyFolderStore *folder_store, + DoubleConnectionInfo *connect_info) +{ + modest_platform_connect_if_remote_and_perform(parent_window, + force, + folder_store, + src_account_connect_performer, + connect_info); +} + GtkWidget * modest_platform_get_account_settings_dialog (ModestAccountSettings *settings) {