2005-08-27 [colin] 1.9.13cvs65
authorColin Leroy <colin@colino.net>
Sat, 27 Aug 2005 18:35:43 +0000 (18:35 +0000)
committerColin Leroy <colin@colino.net>
Sat, 27 Aug 2005 18:35:43 +0000 (18:35 +0000)
* src/folder.c
* src/procmsg.c
* src/procmsg.h
* src/summaryview.c
Fix bug #517 (messages removed from summaryview
when moving fails)

ChangeLog-gtk2.claws
PATCHSETS
configure.ac
src/folder.c
src/procmsg.c
src/procmsg.h
src/summaryview.c

index a835647..1f087b4 100644 (file)
@@ -1,3 +1,12 @@
+2005-08-27 [colin]     1.9.13cvs65
+
+       * src/folder.c
+       * src/procmsg.c
+       * src/procmsg.h
+       * src/summaryview.c
+               Fix bug #517 (messages removed from summaryview 
+               when moving fails)
+
 2005-08-27 [colin]     1.9.13cvs64
 
        * tools/Makefile.am
index 76fdd7a..f1c7c59 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.36.2.40 -r 1.36.2.41 src/common/utils.c;  ) > 1.9.13cvs62.patchset
 ( cvs diff -u -r 1.179.2.60 -r 1.179.2.61 src/imap.c;  cvs diff -u -r 1.1.4.17 -r 1.1.4.18 src/etpan/imap-thread.c;  cvs diff -u -r 1.1.4.4 -r 1.1.4.5 src/etpan/imap-thread.h;  cvs diff -u -r 1.1 -r 1.2 src/gtk/.cvsignore;  ) > 1.9.13cvs63.patchset
 ( cvs diff -u -r 1.25.2.5 -r 1.25.2.6 tools/Makefile.am;  diff -u /dev/null tools/asus_mailled.sh;  ) > 1.9.13cvs64.patchset
+( cvs diff -u -r 1.213.2.53 -r 1.213.2.54 src/folder.c;  cvs diff -u -r 1.150.2.41 -r 1.150.2.42 src/procmsg.c;  cvs diff -u -r 1.60.2.15 -r 1.60.2.16 src/procmsg.h;  cvs diff -u -r 1.395.2.116 -r 1.395.2.117 src/summaryview.c;  ) > 1.9.13cvs65.patchset
index 8334937..a1302ea 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=13
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=64
+EXTRA_VERSION=65
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 9780f7d..58c3abb 100644 (file)
@@ -2818,7 +2818,11 @@ static gint do_copy_msgs(FolderItem *dest, GSList *msglist, gboolean remove_sour
        }
 
        g_relation_destroy(relation);
-       return lastnum;
+       if (not_moved != NULL) {
+               g_slist_free(not_moved);
+               return -1;
+       } else
+               return lastnum;
 }
 
 /**
index 48e949f..379e978 100644 (file)
@@ -332,13 +332,14 @@ GNode *procmsg_get_thread_tree(GSList *mlist)
        return root;
 }
 
-void procmsg_move_messages(GSList *mlist)
+gint procmsg_move_messages(GSList *mlist)
 {
        GSList *cur, *movelist = NULL;
        MsgInfo *msginfo;
        FolderItem *dest = NULL;
+       gint retval = 0;
 
-       if (!mlist) return;
+       if (!mlist) return 0;
 
        folder_item_update_freeze();
 
@@ -360,11 +361,12 @@ void procmsg_move_messages(GSList *mlist)
        }
 
        if (movelist) {
-               folder_item_move_msgs(dest, movelist);
+               retval = folder_item_move_msgs(dest, movelist);
                g_slist_free(movelist);
        }
 
        folder_item_update_thaw();
+       return retval;
 }
 
 void procmsg_copy_messages(GSList *mlist)
index 8d30c0e..bd89894 100644 (file)
@@ -251,7 +251,7 @@ void        procmsg_get_mark_sum            (const gchar    *folder,
 
 GNode  *procmsg_get_thread_tree                (GSList         *mlist);
 
-void   procmsg_move_messages           (GSList         *mlist);
+gint   procmsg_move_messages           (GSList         *mlist);
 void   procmsg_copy_messages           (GSList         *mlist);
 
 /* return path is locale charset */
index 9bf7a37..83365a0 100644 (file)
@@ -208,7 +208,7 @@ static void summary_copy_row_to             (SummaryView            *summaryview,
                                         GtkCTreeNode           *row,
                                         FolderItem             *to_folder);
 
-static void summary_execute_move       (SummaryView            *summaryview);
+static gint summary_execute_move       (SummaryView            *summaryview);
 static void summary_execute_move_func  (GtkCTree               *ctree,
                                         GtkCTreeNode           *node,
                                         gpointer                data);
@@ -3565,6 +3565,7 @@ gboolean summary_execute(SummaryView *summaryview)
        GtkCList *clist = GTK_CLIST(summaryview->ctree);
        GtkCTreeNode *node, *next;
        GtkCTreeNode *new_selected = NULL;
+       gint move_val = -1;
 
        if (!summaryview->folder_item) return FALSE;
 
@@ -3577,7 +3578,7 @@ gboolean summary_execute(SummaryView *summaryview)
                summary_unthread_for_exec(summaryview);
 
        folder_item_update_freeze();
-       summary_execute_move(summaryview);
+       move_val = summary_execute_move(summaryview);
        summary_execute_copy(summaryview);
        summary_execute_delete(summaryview);
        
@@ -3641,26 +3642,30 @@ gboolean summary_execute(SummaryView *summaryview)
        gtk_ctree_node_moveto(ctree, summaryview->selected, -1, 0.5, 0);
 
        summary_unlock(summaryview);
+       
+       if (move_val < 0) 
+               summary_show(summaryview, summaryview->folder_item);
        return TRUE;
 }
 
-static void summary_execute_move(SummaryView *summaryview)
+static gint summary_execute_move(SummaryView *summaryview)
 {
        GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
        GSList *cur;
-
+       gint val = -1;
        /* search moving messages and execute */
        gtk_ctree_pre_recursive(ctree, NULL, summary_execute_move_func,
                                summaryview);
 
        if (summaryview->mlist) {
-               procmsg_move_messages(summaryview->mlist);
+               val = procmsg_move_messages(summaryview->mlist);
 
                for (cur = summaryview->mlist; cur != NULL && cur->data != NULL; cur = cur->next)
                        procmsg_msginfo_free((MsgInfo *)cur->data);
                g_slist_free(summaryview->mlist);
                summaryview->mlist = NULL;
        }
+       return val;
 }
 
 static void summary_execute_move_func(GtkCTree *ctree, GtkCTreeNode *node,