mirror of
https://github.com/transmission/transmission
synced 2024-12-24 08:43:27 +00:00
make tr_stat.everUploaded a tertiary sort key when sorting by progress.
This commit is contained in:
parent
99ddcb8f36
commit
825e1d9334
1 changed files with 8 additions and 1 deletions
|
@ -203,19 +203,23 @@ compareProgress( GtkTreeModel * model,
|
|||
GtkTreeIter * b,
|
||||
gpointer user_data UNUSED )
|
||||
{
|
||||
int ia, ib;
|
||||
gfloat rateUpA, rateUpB;
|
||||
gfloat rateDownA, rateDownB;
|
||||
gfloat percentDoneA, percentDoneB;
|
||||
int ia, ib;
|
||||
guint64 uploadedEverA, uploadedEverB;
|
||||
|
||||
gtk_tree_model_get( model, a, MC_PROG_D, &percentDoneA,
|
||||
MC_DRATE, &rateDownA,
|
||||
MC_URATE, &rateUpA,
|
||||
MC_UP, &uploadedEverA,
|
||||
-1 );
|
||||
gtk_tree_model_get( model, b, MC_PROG_D, &percentDoneB,
|
||||
MC_DRATE, &rateDownB,
|
||||
MC_URATE, &rateUpB,
|
||||
MC_UP, &uploadedEverB,
|
||||
-1 );
|
||||
|
||||
ia = (int)( 100.0 * percentDoneA );
|
||||
ib = (int)( 100.0 * percentDoneB );
|
||||
if( ia != ib )
|
||||
|
@ -226,6 +230,9 @@ compareProgress( GtkTreeModel * model,
|
|||
if( ia != ib )
|
||||
return ia - ib;
|
||||
|
||||
if( uploadedEverA != uploadedEverB )
|
||||
return uploadedEverA < uploadedEverB ? -1 : 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue