Bugfix for 61408
authorPhilip Van Hoof <philip@codeminded.be>
Mon, 25 Jun 2007 20:07:50 +0000 (20:07 +0000)
committerPhilip Van Hoof <philip@codeminded.be>
Mon, 25 Jun 2007 20:07:50 +0000 (20:07 +0000)
pmo-trunk-r2416

src/maemo/modest-main-window.c
src/maemo/modest-msg-edit-window.c
src/modest-tny-account.c
src/modest-tny-local-folders-account.c

index bd2b9de..bea2bae 100644 (file)
@@ -514,7 +514,7 @@ on_account_store_connecting_finished (TnyAccountStore *store, ModestMainWindow *
 
        TnyDevice *device = tny_account_store_get_device (store);
 
 
        TnyDevice *device = tny_account_store_get_device (store);
 
-       modest_folder_view_update_model (MODEST_FOLDER_VIEW (priv->folder_view), store);
+       /* modest_folder_view_update_model (MODEST_FOLDER_VIEW (priv->folder_view), store); */
        
        /* Check that we are really online.
         * This signal should not be emitted when we are not connected, 
        
        /* Check that we are really online.
         * This signal should not be emitted when we are not connected, 
index c120bb0..cd6fa56 100644 (file)
@@ -1486,9 +1486,9 @@ modest_msg_edit_window_insert_image (ModestMsgEditWindow *window)
 
                        loader = gdk_pixbuf_loader_new_with_mime_type (mime_type, NULL);
                        while (!tny_stream_is_eos (TNY_STREAM (stream))) {
 
                        loader = gdk_pixbuf_loader_new_with_mime_type (mime_type, NULL);
                        while (!tny_stream_is_eos (TNY_STREAM (stream))) {
-                               char read_buffer[128];
+                               unsigned char read_buffer[128];
                                gint readed;
                                gint readed;
-                               readed = tny_stream_read (TNY_STREAM (stream), read_buffer, 128);
+                               readed = tny_stream_read (TNY_STREAM (stream), (char *) read_buffer, 128);
                                if (!gdk_pixbuf_loader_write (loader, read_buffer, readed, NULL))
                                        break;
                        }
                                if (!gdk_pixbuf_loader_write (loader, read_buffer, readed, NULL))
                                        break;
                        }
index 42dffc8..25549ee 100644 (file)
@@ -324,10 +324,12 @@ modest_tny_account_new_from_server_account (ModestAccountMgr *account_mgr,
        /* FIXME: for debugging. 
         * Let's keep this because it is very useful for debugging. */
        url = tny_account_get_url_string (TNY_ACCOUNT(tny_account));
        /* FIXME: for debugging. 
         * Let's keep this because it is very useful for debugging. */
        url = tny_account_get_url_string (TNY_ACCOUNT(tny_account));
-    printf ("DEBUG %s:\n  account-url: %s\n", __FUNCTION__, url);
+
+       printf ("DEBUG %s:\n  account-url: %s\n", __FUNCTION__, url);
+
        g_free (url);
        /***********************/
        g_free (url);
        /***********************/
-       
+
        return tny_account;
 }
 
        return tny_account;
 }
 
@@ -408,6 +410,18 @@ modest_tny_account_new_from_account (ModestAccountMgr *account_mgr, const gchar
        tny_account_set_pass_func (tny_account,
                                   get_pass_func ? get_pass_func: get_pass_dummy);
        
        tny_account_set_pass_func (tny_account,
                                   get_pass_func ? get_pass_func: get_pass_dummy);
        
+
+       TnyAccountStore *astore = (TnyAccountStore *) modest_runtime_get_account_store ();
+       if (astore) {
+               TnyDevice *device = tny_account_store_get_device (astore);
+               GError *err = NULL;
+               tny_camel_account_set_online (TNY_CAMEL_ACCOUNT (tny_account),
+                               tny_device_is_online (device), &err);
+               if (err)
+                       g_print ("Error connecting: %s\n", err->message);
+               g_object_unref (device);
+       }
+       
        /* This name is what shows up in the folder view -- so for some POP/IMAP/... server
         * account, we set its name to the account of which it is part. */
        if (account_data->display_name)
        /* This name is what shows up in the folder view -- so for some POP/IMAP/... server
         * account, we set its name to the account of which it is part. */
        if (account_data->display_name)
index aa3948e..a884c42 100644 (file)
@@ -161,6 +161,7 @@ get_folders (TnyFolderStore *self, TnyList *list, TnyFolderStoreQuery *query, GE
        while (iter)
        {
                TnyFolder *folder = TNY_FOLDER (iter->data);
        while (iter)
        {
                TnyFolder *folder = TNY_FOLDER (iter->data);
+
                if (folder)
                        tny_list_append (list, G_OBJECT (folder));
                        
                if (folder)
                        tny_list_append (list, G_OBJECT (folder));