stupido fixes his segfaults
authorColin Leroy <colin@colino.net>
Fri, 8 Nov 2002 17:36:53 +0000 (17:36 +0000)
committerColin Leroy <colin@colino.net>
Fri, 8 Nov 2002 17:36:53 +0000 (17:36 +0000)
ChangeLog.claws
configure.in
src/folder.c
src/folderview.c

index 5349bf4d84c111fef22115a4e833f7eb28340621..62954c9aeee97614e5defe813131b6aad95b10ea 100644 (file)
@@ -1,3 +1,10 @@
+2002-11-08 [colin]     0.8.5claws96
+
+       * src/folder.c
+         src/folderview.c
+               Fix segfaults, call me stupido
+       
+
 2002-11-08 [colin]     0.8.5claws95
 
        *src/folder.c
index 9ca3685d84dde02779f7bd218fc4639027a215f1..42f92c6dc419c59e15397c81b97a6b2f0c90e020 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=8
 MICRO_VERSION=5
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws95
+EXTRA_VERSION=claws96
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index 806456cd80d9efe5e707feaddc111b2d15d02905..b00d0bbb77a50651b5896bd93a588b9de8b5d0c3 100644 (file)
@@ -1494,7 +1494,8 @@ FolderItem *folder_item_move_to(FolderItem *src, FolderItem *dest)
        FolderItem *tmp = dest->parent;
        char * srcpath, * dstpath;
        char * phys_srcpath, * phys_dstpath;
-
+       GNode *src_node;
+       
        while (tmp) {
                if (tmp == src) {
                        alertpanel_error(_("Can't move a folder to one of its children."));
@@ -1542,6 +1543,11 @@ FolderItem *folder_item_move_to(FolderItem *src, FolderItem *dest)
                                                NULL));
 
        src->folder->remove_folder(src->folder, src);
+       src_node = g_node_find(src->folder->node, G_PRE_ORDER, G_TRAVERSE_ALL, src);
+       if (src_node) 
+               g_node_destroy(src_node);
+       else
+               printf("can't remove node: is null !\n");
        /* not to much worry if remove fails, move has been done */
        
        folder_write_list();
index 1a3b954dd2bccaa9054ba42410b26ad70f8b4c3c..66ae997fd56313e1f4bf7c1722ff1ee49eaff35f 100644 (file)
@@ -1262,6 +1262,21 @@ void folderview_update_item(FolderItem *item, gboolean update_summary)
        }
 }
 
+static folderview_update_item_recursive (FolderItem *item, gboolean update_summary)
+{
+       GNode *node = item->folder->node;       
+       node = g_node_find(node, G_PRE_ORDER, G_TRAVERSE_ALL, item);
+       node = node->children;
+       folderview_update_item(item, update_summary);
+       while (node != NULL) {
+               if (node && node->data) {
+                       FolderItem *next_item = (FolderItem*) node->data;
+                       folderview_update_item(next_item, update_summary);
+               }
+               node = node->next;
+       }
+}
+
 void folderview_update_items_when_required(gboolean update_summary)
 {
        GList *list;
@@ -2691,10 +2706,12 @@ static void folderview_drag_received_cb(GtkWidget        *widget,
                
                folderview_create_folder_node_recursive(folderview, new_item);
                folderview_update_item(src_parent, TRUE);
-               folderview_update_item(new_item, TRUE);
+               folderview_update_item_recursive(new_item, TRUE);
                STATUSBAR_PUSH(folderview->mainwin, _("Done."));
                main_window_cursor_normal(folderview->mainwin);
                summary_clear_all(folderview->summaryview);
+               folderview->opened = NULL;
+               folderview->selected = NULL;
                if (new_item)
                        folderview_select(folderview, new_item);
        }