X-Git-Url: http://geeqie.org/cgi-bin/gitweb.cgi?p=geeqie.git;a=blobdiff_plain;f=src%2Ffilecluster.c;h=e8f6252c07bf68fc9d42387501b4be0bf44d9cae;hp=2b7ebccbc5af3cc9557b61bc336ac62aed1849ab;hb=e0ad96c18c2eaafac5d70ac4342db5a1b0bac448;hpb=e7c45a6fc20c21622ed6af044c5261d8bc835012 diff --git a/src/filecluster.c b/src/filecluster.c index 2b7ebccb..e8f6252c 100644 --- a/src/filecluster.c +++ b/src/filecluster.c @@ -124,22 +124,24 @@ gboolean fileclusterlist_has_head(FileClusterList *fcl, FileData *fd) { FileCluster *fc = g_hash_table_lookup(fcl->clusters, fd); if (!fc) return FALSE; - return fc->head->data == fd; + return filecluster_fd_equal(fc->head->data, fd); } gboolean fileclusterlist_has_child(FileClusterList *fcl, FileData *fd) { FileCluster *fc = g_hash_table_lookup(fcl->clusters, fd); if (!fc) return FALSE; - return fc->head->data != fd; + return !filecluster_fd_equal(fc->head->data, fd); } 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; + // Only difference vs. fileclusterlist_has_child. Basically, if the node is a child, but + // we're showing children, then don't hide. + if (fc->show_children) return FALSE; + return !filecluster_fd_equal(fc->head->data, fd); } // TODO(xsdg): pick a better name for this function