[gthumb] file store: fixed reordering after changing metadata
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gthumb] file store: fixed reordering after changing metadata
- Date: Sun, 25 Sep 2016 07:40:39 +0000 (UTC)
commit 3899f09fa85139aba2e8fbce8874aa598225546e
Author: Paolo Bacchilega <paobac src gnome org>
Date: Sun Sep 25 09:38:11 2016 +0200
file store: fixed reordering after changing metadata
gthumb/gth-file-store.c | 30 ++++++++++++++++++------------
1 files changed, 18 insertions(+), 12 deletions(-)
---
diff --git a/gthumb/gth-file-store.c b/gthumb/gth-file-store.c
index 50beb2a..2c2afed 100644
--- a/gthumb/gth-file-store.c
+++ b/gthumb/gth-file-store.c
@@ -825,18 +825,6 @@ g_print ("UPDATE VISIBILITY\n");
j++;
}
- /* reorder
- *
- * if there is no ordering (file_store->priv->cmp_func == NULL) make
- * sure all_rows preserve the order of the visible rows, sorting by
- * position (compare_by_pos) */
-
- g_qsort_with_data (all_rows,
- all_rows_n,
- (gsize) sizeof (GthFileRow *),
- (file_store->priv->cmp_func == NULL) ? compare_by_pos : compare_row_func,
- file_store);
-
/* old_rows is equal to file_store->priv->rows but points to
* the rows of all_rows */
@@ -850,6 +838,24 @@ g_print ("UPDATE VISIBILITY\n");
}
}
+ /* make sure old_rows preserve the order of the visible rows, sorting by
+ * position (compare_by_pos) */
+
+ g_qsort_with_data (old_rows,
+ old_rows_n,
+ (gsize) sizeof (GthFileRow *),
+ compare_by_pos,
+ file_store);
+
+ /* sort */
+
+ if (file_store->priv->cmp_func != NULL)
+ g_qsort_with_data (all_rows,
+ all_rows_n,
+ (gsize) sizeof (GthFileRow *),
+ compare_row_func,
+ file_store);
+
/* filter */
/* store the new_rows file positions in an hash table for
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]