+static gboolean fileclusterlist_should_hide(FileClusterList *fcl, FileData *fd)
+{
+ FileCluster *fc = g_hash_table_lookup(fcl->clusters, fd);
+ if (!fc) return FALSE;
+ if (fc->show_children) return FALSE; // TODO(xsdg): new function "should_show"
+ return fc->head->data != fd;
+}
+
+// TODO(xsdg): pick a better name for this function
+GList *fileclusterlist_next_non_child(FileClusterList *fcl, GList *list)
+{
+ // Check for no-ops
+ if (!list || !g_hash_table_size(fcl->clusters)) return list;
+
+ // Clusters are being used, so we have to actually check things.
+ for (; list; list = list->next)
+ {
+ FileData *fd = list->data;
+ if (!fileclusterlist_has_child(fcl, fd)) return list;
+ }
+
+ return NULL;
+}
+
+GList *fileclusterlist_remove_children_from_list(FileClusterList *fcl, GList *list)