From 85243b64af42a1b5bd646981834eec89ec69fb6e Mon Sep 17 00:00:00 2001 From: Omari Stephens Date: Sat, 8 Jul 2017 03:57:18 +0000 Subject: [PATCH] Add FileClusterList to ViewFile --- src/filecluster.h | 19 ------------------- src/typedefs.h | 20 ++++++++++++++++++++ 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/src/filecluster.h b/src/filecluster.h index 07d3be1b..3b002dc1 100644 --- a/src/filecluster.h +++ b/src/filecluster.h @@ -21,25 +21,6 @@ #include "main.h" -typedef struct _FileCluster FileCluster; -typedef struct _FileClusterList FileClusterList; - -// A FileCluster is a GList with HashTable access to each node (to perform contains() checks quickly). -struct _FileCluster -{ - GList *head; - GList *items; -}; - -struct _FileClusterList -{ - // All of the elements in the list, regardless of whether they're part of a cluster or not. - GList *fd_list; - - // A map from any clustered FileData to the FileCluster object that describes the cluster. - GHashTable *clusters; -}; - FileClusterList *fileclusterlist_new(); FileCluster *filecluster_new(); // internal? void fileclusterlist_free(FileClusterList *fcl); diff --git a/src/typedefs.h b/src/typedefs.h index 9d7db51f..cbaf56da 100644 --- a/src/typedefs.h +++ b/src/typedefs.h @@ -271,6 +271,9 @@ typedef struct _CollectWindow CollectWindow; typedef struct _ImageWindow ImageWindow; +typedef struct _FileCluster FileCluster; +typedef struct _FileClusterList FileClusterList; + typedef struct _FileData FileData; typedef struct _FileDataChangeInfo FileDataChangeInfo; @@ -529,6 +532,22 @@ struct _ImageWindow gboolean mouse_wheel_mode; }; +// A FileCluster is a GList with HashTable access to each node (to perform contains() checks quickly). +struct _FileCluster +{ + GList *head; + GList *items; +}; + +struct _FileClusterList +{ + // All of the elements in the list, regardless of whether they're part of a cluster or not. + GList *fd_list; + + // A map from any clustered FileData to the FileCluster object that describes the cluster. + GHashTable *clusters; +}; + #define FILEDATA_MARKS_SIZE 6 struct _FileDataChangeInfo { @@ -843,6 +862,7 @@ struct _ViewFile FileData *dir_fd; GList *list; + FileClusterList *cluster_list; SortType sort_method; gboolean sort_ascend; -- 2.20.1