Add FileClusterList to ViewFile
authorOmari Stephens <xsdg@google.com>
Sat, 8 Jul 2017 03:57:18 +0000 (03:57 +0000)
committerOmari Stephens <xsdg@google.com>
Mon, 10 Jul 2017 08:00:55 +0000 (08:00 +0000)
src/filecluster.h
src/typedefs.h

index 07d3be1..3b002dc 100644 (file)
 
 #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);
index 9d7db51..cbaf56d 100644 (file)
@@ -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;