[gthumb] sort by name if the date is the same



commit 27364d76d868489829b2c24b54cae7a0dd6f6348
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Tue Aug 14 19:01:43 2012 +0200

    sort by name if the date is the same
    
    [bug #676263]

 extensions/exiv2_tools/main.c |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)
---
diff --git a/extensions/exiv2_tools/main.c b/extensions/exiv2_tools/main.c
index 92bd325..1519404 100644
--- a/extensions/exiv2_tools/main.c
+++ b/extensions/exiv2_tools/main.c
@@ -235,6 +235,7 @@ gth_file_data_cmp_date_time_original (GthFileData *a,
 {
 	GTimeVal *pta, *ptb;
 	GTimeVal  ta, tb;
+	int       result;
 
 	pta = NULL;
 	if (gth_file_data_get_digitalization_time (a, &ta))
@@ -248,7 +249,17 @@ gth_file_data_cmp_date_time_original (GthFileData *a,
 	if (ptb == NULL)
 		ptb = gth_file_data_get_modification_time (b);
 
-	return _g_time_val_cmp (pta, ptb);
+	result = _g_time_val_cmp (pta, ptb);
+	if (result == 0) {
+		const char *key_a, *key_b;
+
+		key_a = gth_file_data_get_filename_sort_key (a);
+		key_b = gth_file_data_get_filename_sort_key (b);
+
+		result = strcmp (key_a, key_b);
+	}
+
+	return result;
 }
 
 



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