Ignore:
Timestamp:
Mar 4, 2009, 7:52:57 PM (13 years ago)
Author:
charles
Message:

(trunk) libT and gtk+ parts for #1889: per-torrent vs. global speed limit confusion

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/rpcimpl.c

    r8006 r8021  
    367367    else if( !strcmp( key, "downloaders" ) )
    368368        tr_bencDictAddInt( d, key, st->downloaders );
    369     else if( !strcmp( key, "downloadLimitMode" ) )
    370         tr_bencDictAddInt( d, key, tr_torrentGetSpeedMode( tor, TR_DOWN ) );
    371     else if( !strcmp( key, "downloadLimit" ) )
    372         tr_bencDictAddInt( d, key, tr_torrentGetSpeedLimit( tor, TR_DOWN ) );
    373369    else if( !strcmp( key, "error" ) )
    374370        tr_bencDictAddInt( d, key, st->error );
     
    457453    else if( !strcmp( key, "sizeWhenDone" ) )
    458454        tr_bencDictAddInt( d, key, st->sizeWhenDone );
     455    else if( !strcmp( key, "speed-limit-down" ) )
     456        tr_bencDictAddInt( d, key, tr_torrentGetSpeedLimit( tor, TR_DOWN ) );
     457    else if( !strcmp( key, "speed-limit-down-enabled" ) )
     458        tr_bencDictAddInt( d, key, tr_torrentIsUsingSpeedLimit( tor, TR_DOWN ) );
     459    else if( !strcmp( key, "speed-limit-down-global-enabled" ) )
     460        tr_bencDictAddInt( d, key, tr_torrentIsUsingGlobalSpeedLimit( tor, TR_DOWN ) );
     461    else if( !strcmp( key, "speed-limit-up" ) )
     462        tr_bencDictAddInt( d, key, tr_torrentGetSpeedLimit( tor, TR_UP ) );
     463    else if( !strcmp( key, "speed-limit-up-enabled" ) )
     464        tr_bencDictAddInt( d, key, tr_torrentIsUsingSpeedLimit( tor, TR_UP ) );
     465    else if( !strcmp( key, "speed-limit-up-global-enabled" ) )
     466        tr_bencDictAddInt( d, key, tr_torrentIsUsingGlobalSpeedLimit( tor, TR_UP ) );
    459467    else if( !strcmp( key, "startDate" ) )
    460468        tr_bencDictAddInt( d, key, st->startDate );
     
    471479    else if( !strcmp( key, "uploadedEver" ) )
    472480        tr_bencDictAddInt( d, key, st->uploadedEver );
    473     else if( !strcmp( key, "uploadLimitMode" ) )
    474         tr_bencDictAddInt( d, key,   tr_torrentGetSpeedMode( tor, TR_UP ) );
    475     else if( !strcmp( key, "uploadLimit" ) )
    476         tr_bencDictAddInt( d, key, tr_torrentGetSpeedLimit( tor, TR_UP ) );
    477481    else if( !strcmp( key, "uploadRatio" ) )
    478482        tr_bencDictAddDouble( d, key,
     
    645649            tr_torrentSetSpeedLimit( tor, TR_DOWN, tmp );
    646650        if( tr_bencDictFindInt( args_in, "speed-limit-down-enabled", &tmp ) )
    647             tr_torrentSetSpeedMode(
    648                 tor, TR_DOWN, tmp ? TR_SPEEDLIMIT_SINGLE
    649                 : TR_SPEEDLIMIT_GLOBAL );
     651            tr_torrentUseSpeedLimit( tor, TR_DOWN, tmp!=0 );
     652        if( tr_bencDictFindInt( args_in, "speed-limit-down-global-enabled", &tmp ) )
     653            tr_torrentUseGlobalSpeedLimit( tor, TR_DOWN, tmp!=0 );
    650654        if( tr_bencDictFindInt( args_in, "speed-limit-up", &tmp ) )
    651655            tr_torrentSetSpeedLimit( tor, TR_UP, tmp );
    652656        if( tr_bencDictFindInt( args_in, "speed-limit-up-enabled", &tmp ) )
    653             tr_torrentSetSpeedMode( tor, TR_UP, tmp ? TR_SPEEDLIMIT_SINGLE
    654                                     : TR_SPEEDLIMIT_GLOBAL );
     657            tr_torrentUseSpeedLimit( tor, TR_UP, tmp!=0 );
     658        if( tr_bencDictFindInt( args_in, "speed-limit-up-global-enabled", &tmp ) )
     659            tr_torrentUseGlobalSpeedLimit( tor, TR_UP, tmp!=0 );
    655660        if( tr_bencDictFindDouble( args_in, "ratio-limit", &d ) )
    656661            tr_torrentSetRatioLimit( tor, d );
Note: See TracChangeset for help on using the changeset viewer.