move slist of nodes to be recollapsed in folderview struct
authorColin Leroy <colin@colino.net>
Mon, 25 Nov 2002 23:04:33 +0000 (23:04 +0000)
committerColin Leroy <colin@colino.net>
Mon, 25 Nov 2002 23:04:33 +0000 (23:04 +0000)
ChangeLog.claws
configure.in
src/folderview.c
src/folderview.h

index 71d2f62a8c1d84fd45350f82f7fdadf7d3b77fc9..025ea75c44008ee897295d1d035a30a0519712ef 100644 (file)
@@ -1,3 +1,9 @@
+2002-11-25 [colin]     0.8.6claws10
+
+       * src/folderview.[ch]
+               Variable renaming and cleaning (slist of nodes 
+               to be re-collapsed is stored in FolderView)
+
 2002-11-25 [paul]      0.8.6claws9
 
        * src/prefs_common.[ch]
index e93649ee5031faccb3461db66562e67337708038..c4f9dcc609dc3d6d0859b12ad9cdaaa4d91c7e30 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=8
 MICRO_VERSION=6
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws9
+EXTRA_VERSION=claws10
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index 6cf17dc977a59e002de5b6b39df8a7eb7cb5a91c..093eb8af453676ca275a9a3edd601236ea76a867 100644 (file)
@@ -2510,12 +2510,13 @@ static void folderview_property_cb(FolderView *folderview, guint action,
 #endif 
 }
 
-static GSList *recollapse_folders = NULL;
-static void folderview_recollapse(GtkCTree *ctree, GtkCTreeNode *node)
+static void folderview_recollapse_nodes(FolderView *folderview, GtkCTreeNode *node)
 {
        GSList *list = NULL;
        GSList *done = NULL;
-       for (list = recollapse_folders; list != NULL; list = g_slist_next(list)) {
+       GtkCTree *ctree = GTK_CTREE(folderview->ctree);
+       
+       for (list = folderview->nodes_to_recollapse; list != NULL; list = g_slist_next(list)) {
                if (!gtkut_ctree_node_is_parent(GTK_CTREE_NODE(list->data), node)
                &&  list->data != node) {
                        gtk_ctree_collapse(ctree, GTK_CTREE_NODE(list->data));
@@ -2523,7 +2524,8 @@ static void folderview_recollapse(GtkCTree *ctree, GtkCTreeNode *node)
                }
        }
        for (list = done; list != NULL; list = g_slist_next(list)) {
-               recollapse_folders = g_slist_remove(recollapse_folders, list->data);
+               folderview->nodes_to_recollapse = g_slist_remove(folderview->nodes_to_recollapse, 
+                                                                list->data);
        }
        g_slist_free(done);
 }
@@ -2566,10 +2568,12 @@ static gboolean folderview_drag_motion_cb(GtkWidget      *widget,
        }
 
        if (acceptable) {
-               folderview_recollapse(GTK_CTREE(widget), node);
+               folderview_recollapse_nodes(folderview, node);
                if (item->collapsed) {
                        gtk_ctree_expand(GTK_CTREE(widget), node);
-                       recollapse_folders = g_slist_append(recollapse_folders, node);
+                       folderview->nodes_to_recollapse = g_slist_append(
+                                                               folderview->nodes_to_recollapse,
+                                                               node);
                }
 
                gtk_signal_handler_block_by_func
@@ -2717,7 +2721,7 @@ static void folderview_drag_received_cb(GtkWidget        *widget,
                inc_unlock();           
                gtk_widget_set_sensitive(folderview->ctree, TRUE);
        }
-       recollapse_folders = NULL;
+       folderview->nodes_to_recollapse = NULL;
 }
 
 static gint folderview_clist_compare(GtkCList *clist,
@@ -2813,7 +2817,7 @@ static void folderview_start_drag(GtkWidget *widget, gint button, GdkEvent *even
 
        list = gtk_target_list_new(folderview_drag_types, 1);
 
-       recollapse_folders = NULL; /* in case the last drag has been cancelled */
+       folderview->nodes_to_recollapse = NULL; /* in case the last drag has been cancelled */
        
        context = gtk_drag_begin(widget, list,
                                 GDK_ACTION_MOVE|GDK_ACTION_COPY|GDK_ACTION_DEFAULT, button, event);
index 7bbc84a7ad17f556e7c14bd7179304f2fae42e5a..9eeebc10de45691debfc646e73d1aa4c0be59078 100644 (file)
@@ -57,6 +57,9 @@ struct _FolderView
        SummaryView  *summaryview;
 
        gint folder_item_update_callback_id;
+       
+       /* for drag and drop */
+       GSList *nodes_to_recollapse;
 };
 
 FolderView *folderview_create          (void);