From: Omari Stephens Date: Sun, 9 Jul 2017 18:21:12 +0000 (+0000) Subject: Start the basics of setting the CLUSTER_CHILD flag on children. X-Git-Url: http://geeqie.org/cgi-bin/gitweb.cgi?p=geeqie.git;a=commitdiff_plain;h=e7c45a6fc20c21622ed6af044c5261d8bc835012 Start the basics of setting the CLUSTER_CHILD flag on children. --- diff --git a/src/view_file/view_file_icon.c b/src/view_file/view_file_icon.c index c2a423b9..cd5d05ce 100644 --- a/src/view_file/view_file_icon.c +++ b/src/view_file/view_file_icon.c @@ -1267,7 +1267,6 @@ gboolean vficon_press_key_cb(GtkWidget *widget, GdkEventKey *event, gpointer dat fc = fileclusterlist_create_cluster(vf->cluster_list, VFICON(vf)->selection); if (fc) { - // TODO(xsdg): set CLUSTER_CHILD vficon_selection_add(vf, VFICON(vf)->selection->data, SELECTION_CLUSTER_HEAD, NULL); vf_refresh(vf); } @@ -1293,7 +1292,18 @@ gboolean vficon_press_key_cb(GtkWidget *widget, GdkEventKey *event, gpointer dat FileCluster *fc = g_hash_table_lookup(vf->cluster_list->clusters, fd); if (fc) { - filecluster_toggle_show_children(fc); + if (filecluster_toggle_show_children(fc)) + { + for (GList *work = fc->items; work; work = work->next) + { + // TODO(xsdg): This is broken because the FileData pointer stored in the + // cluster is different from the one just added to vf->list, even though + // they are equivalent. + FileData *fd = work->data; + if (work == fc->head) continue; + vficon_selection_add(vf, fd, SELECTION_CLUSTER_CHILD, NULL); + } + } vf_refresh(vf); } }