- /* This blocks on the result: */
- /* TODO: Fix tinymail to take user_data for the callback instead of using one static instance: */
- if (user_data) {
- g_slice_free (UserData, user_data);
- user_data = NULL;
- }
-
- user_data = g_slice_new0 (UserData);
- user_data->loop = g_main_loop_new (NULL, FALSE /* not running */);
-
- /* We get a warning if we don't do use tny_camel_account_set_online():
- * GLIB CRITICAL ** camel-lite - camel_service_query_auth_types: assertion `service != NULL' failed.
- */
- tny_camel_account_set_online (TNY_CAMEL_ACCOUNT (tny_account), TRUE, &on_account_online);
- printf ("DEBUGa2: %s\n", __FUNCTION__);
-
- /* This main loop will run until the idle handler has stopped it: */
- printf ("DEBUG: %s: before g_main_loop_run()\n", __FUNCTION__);
- GDK_THREADS_LEAVE();
- g_main_loop_run (user_data->loop);
- GDK_THREADS_ENTER();
- printf ("DEBUG: %s: after g_main_loop_run()\n", __FUNCTION__);
- g_main_loop_unref (user_data->loop);
- /* g_main_context_unref (context); */
-
- g_slice_free (UserData, user_data);
- user_data = NULL;
-
-