2007-09-03 Armin Burgmeier <armin@openismus.com>
authorArmin Burgmeier <armin@openismus.com>
Mon, 3 Sep 2007 17:32:12 +0000 (17:32 +0000)
committerArmin Burgmeier <armin@openismus.com>
Mon, 3 Sep 2007 17:32:12 +0000 (17:32 +0000)
* src/maemo/modest-maemo-utils.c: Don't set the temporary account
online that checks for supported authentication methods. This fixes
projects.maemo.org bug NB#61369.

pmo-trunk-r3195

ChangeLog2
src/maemo/modest-maemo-utils.c

index dcab839..478546b 100644 (file)
@@ -1,3 +1,9 @@
+2007-09-03  Armin Burgmeier  <armin@openismus.com>
+
+       * src/maemo/modest-maemo-utils.c: Don't set the temporary account
+       online that checks for supported authentication methods. This fixes
+       projects.maemo.org bug NB#61369.
+
 2007-09-03  Murray Cumming  <murrayc@murrayc.com>
 
        * src/widgets/modest-folder-view.c: (strings_are_equal),
index b385e5d..6ee96b3 100644 (file)
@@ -403,29 +403,6 @@ static void on_secure_auth_cancel(GtkWidget* dialog, int response, gpointer user
        }
 }
 
-
-typedef struct
-{
-       GMainLoop* loop;
-} UserData;
-
-static UserData *user_data = NULL;
-
-static void
-on_account_online (TnyCamelAccount *account, GError *err)
-{
-       printf ("DEBUGa1: %s\n", __FUNCTION__);
-       
-       if (err) {
-               printf("DEBUG: %s: error=\n  %s\n", __FUNCTION__, err->message);        
-       }
-       
-       /* Allow the function that requested this callback to continue: */
-       /* TODO: Tinymail should really give us user_data with this callback. */
-       if (user_data && user_data->loop)
-               g_main_loop_quit (user_data->loop);
-}
-
 GList*
 modest_maemo_utils_get_supported_secure_authentication_methods (ModestTransportStoreProtocol proto, 
        const gchar* hostname, gint port, const gchar* username, GtkWindow *parent_window, GError** error)
@@ -485,35 +462,6 @@ modest_maemo_utils_get_supported_secure_authentication_methods (ModestTransportS
        tny_camel_account_set_session (TNY_CAMEL_ACCOUNT(tny_account), session);
        
        
-       /* 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;
-       
-       
        /* Ask camel to ask the server, asynchronously: */
        ModestGetSupportedAuthInfo *info = g_slice_new (ModestGetSupportedAuthInfo);
        info->result = NULL;