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:
parent
d8fe88ae9e
commit
0219e3deff
1 changed files with 11 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue