1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-03-10 06:02:57 +00:00

(gtk) when sorting torrents by status, add progress as a secondary sort key. (Lacrocivious)

This commit is contained in:
Charles Kerr 2008-02-04 18:40:56 +00:00
parent d8fe88ae9e
commit 0219e3deff

View file

@ -252,12 +252,20 @@ static int
compareByState( GtkTreeModel * model,
GtkTreeIter * a,
GtkTreeIter * b,
gpointer user_data UNUSED )
gpointer user_data )
{
int sa, sb;
int sa, sb, ret;
/* first by state */
gtk_tree_model_get( model, a, MC_STATUS, &sa, -1 );
gtk_tree_model_get( model, b, MC_STATUS, &sb, -1 );
return sa - sb;
ret = sa - sb;
/* second by progress */
if( !ret )
ret = compareByProgress( model, a, b, user_data );
return ret;
}
static int