Uses custom hash/equals functions so that we can actually fetch equivalent FileDatas...
[geeqie.git] / src / view_file / view_file_list.c
index bee6bfc..86cb612 100644 (file)
@@ -27,6 +27,7 @@
 #include "dnd.h"
 #include "editors.h"
 #include "img-view.h"
+#include "filecluster.h"
 #include "layout.h"
 #include "layout_image.h"
 #include "menu.h"
@@ -1102,6 +1103,7 @@ FileData *vflist_thumb_next_fd(ViewFile *vf)
                store = gtk_tree_view_get_model(GTK_TREE_VIEW(vf->listview));
                gtk_tree_model_get_iter(store, &iter, tpath);
                gtk_tree_path_free(tpath);
+               tpath = NULL;
 
                while (!fd && valid && tree_view_row_get_visibility(GTK_TREE_VIEW(vf->listview), &iter, FALSE) == 0)
                        {
@@ -1143,33 +1145,12 @@ FileData *vflist_thumb_next_fd(ViewFile *vf)
        return fd;
 }
 
-
-void vflist_thumb_reset_all(ViewFile *vf)
-{
-       GList *work = vf->list;
-       while (work)
-               {
-               FileData *fd = work->data;
-               if (fd->thumb_pixbuf)
-                       {
-                       g_object_unref(fd->thumb_pixbuf);
-                       fd->thumb_pixbuf = NULL;
-                       }
-               work = work->next;
-               }
-}
-
 /*
  *-----------------------------------------------------------------------------
  * row stuff
  *-----------------------------------------------------------------------------
  */
 
-FileData *vflist_index_get_data(ViewFile *vf, gint row)
-{
-       return g_list_nth_data(vf->list, row);
-}
-
 gint vflist_index_by_fd(ViewFile *vf, FileData *fd)
 {
        gint p = 0;
@@ -1200,44 +1181,6 @@ gint vflist_index_by_fd(ViewFile *vf, FileData *fd)
        return -1;
 }
 
-guint vflist_count(ViewFile *vf, gint64 *bytes)
-{
-       if (bytes)
-               {
-               gint64 b = 0;
-               GList *work;
-
-               work = vf->list;
-               while (work)
-                       {
-                       FileData *fd = work->data;
-                       work = work->next;
-                       b += fd->size;
-                       }
-
-               *bytes = b;
-               }
-
-       return g_list_length(vf->list);
-}
-
-GList *vflist_get_list(ViewFile *vf)
-{
-       GList *list = NULL;
-       GList *work;
-
-       work = vf->list;
-       while (work)
-               {
-               FileData *fd = work->data;
-               work = work->next;
-
-               list = g_list_prepend(list, file_data_ref(fd));
-               }
-
-       return g_list_reverse(list);
-}
-
 /*
  *-----------------------------------------------------------------------------
  * selections
@@ -1726,6 +1669,7 @@ gboolean vflist_refresh(ViewFile *vf)
                        }
 
                vf->list = file_data_filter_marks_list(vf->list, vf_marks_get_filter(vf));
+               vf->list = fileclusterlist_remove_children_from_list(vf->cluster_list, vf->list);
                file_data_register_notify_func(vf_notify_cb, vf, NOTIFY_PRIORITY_MEDIUM);
 
                DEBUG_1("%s vflist_refresh: sort", get_exec_time());