Changeset 3435


Ignore:
Timestamp:
Oct 16, 2007, 2:32:16 PM (14 years ago)
Author:
charles
Message:

make tr_stat.everUploaded a tertiary sort key when sorting by progress.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/tr_core.c

    r3434 r3435  
    204204                 gpointer         user_data UNUSED )
    205205{
     206    int ia, ib;
    206207    gfloat rateUpA, rateUpB;
    207208    gfloat rateDownA, rateDownB;
    208209    gfloat percentDoneA, percentDoneB;
    209     int ia, ib;
     210    guint64 uploadedEverA, uploadedEverB;
    210211
    211212    gtk_tree_model_get( model, a, MC_PROG_D, &percentDoneA,
    212213                                  MC_DRATE, &rateDownA,
    213214                                  MC_URATE, &rateUpA,
     215                                  MC_UP, &uploadedEverA,
    214216                                  -1 );
    215217    gtk_tree_model_get( model, b, MC_PROG_D, &percentDoneB,
    216218                                  MC_DRATE, &rateDownB,
    217219                                  MC_URATE, &rateUpB,
     220                                  MC_UP, &uploadedEverB,
    218221                                  -1 );
     222
    219223    ia = (int)( 100.0 * percentDoneA );
    220224    ib = (int)( 100.0 * percentDoneB );
     
    226230    if( ia != ib )
    227231        return ia - ib;
     232
     233    if( uploadedEverA != uploadedEverB )
     234        return uploadedEverA < uploadedEverB ? -1 : 1;
    228235
    229236    return 0;
Note: See TracChangeset for help on using the changeset viewer.