X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=tests%2Fcheck_update-account.c;h=1202f7a7884394f098a600bca9a4ff233e787dbe;hb=02aac9a2616f3ad4475da0daa7eb1f6ebd02a10d;hp=48ccd392547fc0ae0e0672e90603126ce5b3383c;hpb=ea1bc1ca4a432390eae8705b70384b5c3c2e9c9b;p=modest diff --git a/tests/check_update-account.c b/tests/check_update-account.c index 48ccd39..1202f7a 100644 --- a/tests/check_update-account.c +++ b/tests/check_update-account.c @@ -39,7 +39,7 @@ #include #include -#include "modest-tny-platform-factory.h" +#include #include "modest-account-mgr.h" #include "modest-mail-operation.h" #include "modest-mail-operation-queue.h" @@ -49,7 +49,6 @@ GMainLoop *main_loop; static void on_progress_changed (ModestMailOperation *mail_op, gpointer user_data) { - ModestMailOperationStatus status; ModestMailOperationQueue *queue = NULL; g_print ("Refreshed %d of %d\n", @@ -68,21 +67,18 @@ func (gpointer_data) { TnyStoreAccount *account; TnyIterator *iter; - TnyPlatformFactory *fact = NULL; ModestAccountMgr *acc_mgr = NULL; ModestMailOperation *mail_op = NULL; ModestMailOperationQueue *queue = NULL; - TnyAccountStore *account_store = NULL; + ModestTnyAccountStore *account_store = NULL; TnyList *accounts; - fact = TNY_PLATFORM_FACTORY (modest_tny_platform_factory_get_instance ()); - acc_mgr = MODEST_ACCOUNT_MGR (modest_tny_platform_factory_get_account_mgr_instance (MODEST_TNY_PLATFORM_FACTORY (fact))); - account_store = tny_platform_factory_new_account_store (fact); + acc_mgr = modest_runtime_get_account_mgr(); + account_store = modest_runtime_get_account_store(); /* Get accounts */ accounts = tny_simple_list_new (); - - tny_account_store_get_accounts (account_store, accounts, + tny_account_store_get_accounts (TNY_ACCOUNT_STORE(account_store), accounts, TNY_ACCOUNT_STORE_STORE_ACCOUNTS); iter = tny_list_create_iterator (accounts); @@ -91,16 +87,20 @@ func (gpointer_data) g_object_unref (G_OBJECT (iter)); g_object_unref (G_OBJECT (accounts)); - queue = modest_tny_platform_factory_get_mail_operation_queue_instance (MODEST_TNY_PLATFORM_FACTORY (fact)); - mail_op = modest_mail_operation_new (); + queue = modest_runtime_get_mail_operation_queue (); + mail_op = modest_mail_operation_new (NULL); g_signal_connect (G_OBJECT (mail_op), "progress_changed", G_CALLBACK (on_progress_changed), queue); - if (modest_mail_operation_update_account (mail_op, account)) - modest_mail_operation_queue_add (queue, mail_op); + modest_mail_operation_update_account (mail_op, tny_account_get_name (TNY_ACCOUNT (account)), + TRUE, FALSE, NULL, NULL, NULL); + modest_mail_operation_queue_add (queue, mail_op); g_object_unref (G_OBJECT (mail_op)); + + if (account) + g_object_unref (account); return FALSE; } @@ -114,7 +114,7 @@ main (int argc, char **argv) g_thread_init(NULL); main_loop = g_main_loop_new (NULL, FALSE); - id = g_timeout_add(1000, func, main_loop); + id = g_timeout_add(10, func, main_loop); g_main_loop_run(main_loop);