1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-25 09:13:06 +00:00

Sort files in file window case insensitively.

This commit is contained in:
Josh Elsasser 2007-02-23 20:43:18 +00:00
parent 899f2ab27e
commit 90423e818d

View file

@ -563,7 +563,7 @@ parsepath( GtkTreeStore * store, GtkTreeIter * ret,
{ {
GtkTreeModel * model; GtkTreeModel * model;
GtkTreeIter * parent, start, iter; GtkTreeIter * parent, start, iter;
char * file, * dir, * mykey, * modelkey; char * file, * dir, * lower, * mykey, * modelkey;
const char * stock; const char * stock;
model = GTK_TREE_MODEL( store ); model = GTK_TREE_MODEL( store );
@ -577,7 +577,8 @@ parsepath( GtkTreeStore * store, GtkTreeIter * ret,
parent = &start; parent = &start;
} }
mykey = g_utf8_collate_key( file, -1 ); lower = g_utf8_casefold( file, -1 );
mykey = g_utf8_collate_key( lower, -1 );
if( gtk_tree_model_iter_children( model, &iter, parent ) ) if( gtk_tree_model_iter_children( model, &iter, parent ) )
{ {
do do
@ -606,6 +607,7 @@ parsepath( GtkTreeStore * store, GtkTreeIter * ret,
FC_KEY, mykey, FC_STOCK, stock, FC_SIZE, size, -1 ); FC_KEY, mykey, FC_STOCK, stock, FC_SIZE, size, -1 );
done: done:
g_free( mykey ); g_free( mykey );
g_free( lower );
g_free( file ); g_free( file );
if( NULL != ret ) if( NULL != ret )
{ {