fix processing renaming problems after last commit
authorColin Leroy <colin@colino.net>
Wed, 27 Nov 2002 15:06:54 +0000 (15:06 +0000)
committerColin Leroy <colin@colino.net>
Wed, 27 Nov 2002 15:06:54 +0000 (15:06 +0000)
ChangeLog.claws
configure.in
src/folder.c

index a44f5cbb32d16d0a2091d5d7de62493351903561..7a9e4c740d32f2371b4e614b144ce08f51296799 100644 (file)
@@ -1,3 +1,9 @@
+2002-11-27 [colin]     0.8.6claws21
+
+       * src/folder.c
+               Fix processing renaming problems happening after
+               last commit
+
 2002-11-27 [colin]     0.8.6claws20
 
        * src/folder.c
index 2929e2af3a542cd5379da2e46d6a5484e2f31be6..249b59d6bf781c9253069f238644d15b11cbf039 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=8
 MICRO_VERSION=6
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws20
+EXTRA_VERSION=claws21
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index 49370dd62710d9cd232b35ae49b68717dbc448d4..4066d55fe85235f626a663c6ace157ff93ef976d 100644 (file)
@@ -1518,6 +1518,8 @@ FolderItem *folder_item_move_recursive (FolderItem *src, FolderItem *dest)
        FolderItem *next_item;
        GNode *srcnode;
        int cnt = 0;
+       gchar *old_id, *new_id;
+
        mlist = folder_item_get_msg_list(src);
 
        /* move messages */
@@ -1545,6 +1547,8 @@ FolderItem *folder_item_move_recursive (FolderItem *src, FolderItem *dest)
                folder_item_move_msg(new_item, msginfo);
                if (cnt%500)
                        statusbar_pop_all();
+
+               procmsg_msginfo_free(msginfo);
        }
        
        /*copy prefs*/
@@ -1570,7 +1574,17 @@ FolderItem *folder_item_move_recursive (FolderItem *src, FolderItem *dest)
                                return NULL;
                }
        }
+       old_id = folder_item_get_identifier(src);
+       new_id = folder_item_get_identifier(new_item);
+       debug_print("updating rules : %s => %s\n", old_id, new_id);
+       
        src->folder->remove_folder(src->folder, src);
+       folder_write_list();
+
+       if (old_id != NULL && new_id != NULL)
+               prefs_filtering_rename_path(old_id, new_id);
+       g_free(old_id);
+       g_free(new_id);
 
        return new_item;
 }
@@ -1626,15 +1640,8 @@ gint folder_item_move_to(FolderItem *src, FolderItem *dest, FolderItem **new_ite
                debug_print("can't remove node: it's null!\n");
        /* not to much worry if remove fails, move has been done */
        
-       debug_print("updating rules ....\n");
-       new_identifier = g_strconcat(dst_identifier, G_DIR_SEPARATOR_S, g_basename(phys_srcpath), NULL);
-       prefs_filtering_rename_path(src_identifier, new_identifier);
-
-       folder_write_list();
-
        g_free(src_identifier);
        g_free(dst_identifier);
-       g_free(new_identifier);
        g_free(phys_srcpath);
        g_free(phys_dstpath);