* src/widgets/modest-folder-view.c:
[modest] / src / widgets / modest-folder-view.c
index 69910d8..34ef4a2 100644 (file)
@@ -1069,9 +1069,7 @@ tny_account_store_view_init (gpointer g, gpointer iface_data)
 {
        TnyAccountStoreViewIface *klass = (TnyAccountStoreViewIface *)g;
 
-       klass->set_account_store_func = modest_folder_view_set_account_store;
-
-       return;
+       klass->set_account_store = modest_folder_view_set_account_store;
 }
 
 static void
@@ -1125,8 +1123,14 @@ modest_folder_view_finalize (GObject *obj)
        }
 
        if (priv->cur_folder_store) {
-               if (TNY_IS_FOLDER(priv->cur_folder_store))
-                       tny_folder_sync (TNY_FOLDER(priv->cur_folder_store), FALSE, NULL);
+               if (TNY_IS_FOLDER(priv->cur_folder_store)) {
+                       ModestMailOperation *mail_op;
+
+                       mail_op = modest_mail_operation_new (NULL);
+                       modest_mail_operation_queue_add (modest_runtime_get_mail_operation_queue (),
+                                                        mail_op);
+                       modest_mail_operation_sync_folder (mail_op, TNY_FOLDER (priv->cur_folder_store), FALSE);
+               }
 
                g_object_unref (priv->cur_folder_store);
                priv->cur_folder_store = NULL;
@@ -1973,16 +1977,19 @@ xfer_folder_cb (ModestMailOperation *mail_op,
                gpointer user_data)
 {
        DndHelper *helper;
+       GtkWidget *folder_view;
 
        helper = (DndHelper *) user_data;
+       folder_view = g_object_ref (helper->folder_view);
 
        /* Common part */
        xfer_cb (mail_op, user_data);
 
        /* Select the folder */
        if (new_folder)
-               modest_folder_view_select_folder (MODEST_FOLDER_VIEW (helper->folder_view),
+               modest_folder_view_select_folder (MODEST_FOLDER_VIEW (folder_view),
                                                  new_folder, FALSE);
+       g_object_unref (folder_view);
 }