[gthumb] Sort directories using the same logic used to sort files.



commit 250d30073ab5ccdbf1525643962a9e7621de0f86
Author: Michael J. Chudobiak <mjc avtechpulse com>
Date:   Wed Apr 29 08:10:14 2009 -0400

    Sort directories using the same logic used to sort files.
---
 libgthumb/file-utils.c |    3 ++-
 src/gth-dir-list.c     |    3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/libgthumb/file-utils.c b/libgthumb/file-utils.c
index 6f3ad3e..c9d5615 100644
--- a/libgthumb/file-utils.c
+++ b/libgthumb/file-utils.c
@@ -59,6 +59,7 @@
 #include "pixbuf-utils.h"
 #include "typedefs.h"
 #include "gth-exif-utils.h"
+#include "gth-sort-utils.h"
 
 #ifdef HAVE_LIBOPENRAW
 #include <libopenraw-gnome/gdkpixbuf.h>
@@ -421,7 +422,7 @@ dir_list_filter_and_sort (GList    *dir_list,
 		}
 		scan = scan->next;
 	}
-	filtered = g_list_sort (filtered, (GCompareFunc) strcasecmp);
+	filtered = g_list_sort (filtered, (GCompareFunc) gth_sort_by_full_path);
 
 	return filtered;
 }
diff --git a/src/gth-dir-list.c b/src/gth-dir-list.c
index 2bb6431..5f9512f 100644
--- a/src/gth-dir-list.c
+++ b/src/gth-dir-list.c
@@ -33,6 +33,7 @@
 #include "gconf-utils.h"
 #include "gthumb-marshal.h"
 #include "gthumb-stock.h"
+#include "gth-sort-utils.h"
 #include "main.h"
 #include "pixbuf-utils.h"
 #include "icons/pixbufs.h"
@@ -642,7 +643,7 @@ gth_dir_list_add_directory (GthDirList *dir_list,
 	if (! (file_is_hidden (name_only) && ! dir_list->show_dot_files)
 	    && ! same_uri (name_only, CACHE_DIR))
 		dir_list->list = g_list_prepend (dir_list->list, g_strdup (name_only));
-	dir_list->list = g_list_sort (dir_list->list, (GCompareFunc) strcasecmp);
+	dir_list->list = g_list_sort (dir_list->list, (GCompareFunc) gth_sort_by_full_path);
 
 	/* get the dir position */
 



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