Changeset 9403


Ignore:
Timestamp:
Oct 25, 2009, 6:45:35 PM (13 years ago)
Author:
livings124
Message:

since the Mac UI is the only one to use it, move percentRatio calculation into the Mac code

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/torrent.c

    r9397 r9403  
    10251025    }
    10261026
    1027     if( !checkSeedRatio || s->ratio >= seedRatio || s->ratio == TR_RATIO_INF )
    1028         s->percentRatio = 1.0;
    1029     else if( s->ratio == TR_RATIO_NA )
    1030         s->percentRatio = 0.0;
    1031     else
    1032         s->percentRatio = s->ratio / seedRatio;
    1033 
    10341027    tr_torrentUnlock( tor );
    10351028
  • trunk/libtransmission/transmission.h

    r9387 r9403  
    16291629    float    percentDone;
    16301630
    1631     /** The percentage of the actual ratio to the seed ratio.  This will be
    1632         equal to 1 if the ratio is reached or the torrent is set to seed forever.
    1633         Range is [0..1] */
    1634     float    percentRatio;
    1635 
    16361631    /** Speed all data being sent for this torrent. (KiB/s)
    16371632        This includes piece data, protocol messages, and TCP overhead */
  • trunk/macosx/Torrent.m

    r9402 r9403  
    344344- (CGFloat) progressStopRatio
    345345{
    346     return fStat->percentRatio;
     346    double seedRatio;
     347    if (!tr_torrentGetSeedRatio(fHandle, seedRatio) || [self ratio] >= seedRatio || [self ratio] == TR_RATIO_INF)
     348        return 1.0;
     349    else if ([self ratio] == TR_RATIO_NA)
     350        return 0.0;
     351    else
     352        return [self ratio] / seedRatio;
    347353}
    348354
Note: See TracChangeset for help on using the changeset viewer.