[gthumb] file store: set the sort function to null after reordering



commit a58588dbbd3da73aeda7aa17828059b3473cddbf
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Mon Jan 27 13:05:05 2020 +0100

    file store: set the sort function to null after reordering

 gthumb/gth-file-store.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/gthumb/gth-file-store.c b/gthumb/gth-file-store.c
index 8d99c79c..f734c018 100644
--- a/gthumb/gth-file-store.c
+++ b/gthumb/gth-file-store.c
@@ -1121,13 +1121,21 @@ _gth_file_store_reorder (GthFileStore *file_store)
 }
 
 
+static void
+_gth_file_store_set_sort_func (GthFileStore        *file_store,
+                              GthFileDataCompFunc  cmp_func,
+                              gboolean             inverse_sort)
+{
+       file_store->priv->cmp_func = cmp_func;
+       file_store->priv->inverse_sort = inverse_sort;
+}
+
 void
 gth_file_store_set_sort_func (GthFileStore        *file_store,
                              GthFileDataCompFunc  cmp_func,
                              gboolean             inverse_sort)
 {
-       file_store->priv->cmp_func = cmp_func;
-       file_store->priv->inverse_sort = inverse_sort;
+       _gth_file_store_set_sort_func (file_store, cmp_func, inverse_sort);
        _gth_file_store_reorder (file_store);
 }
 
@@ -1654,6 +1662,8 @@ gth_file_store_reorder (GthFileStore *file_store,
 {
        int i;
 
+       _gth_file_store_set_sort_func (file_store, NULL, FALSE);
+
        for (i = 0; i < file_store->priv->num_rows; i++)
                file_store->priv->rows[new_order[i]]->pos = i;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]