Ignore:
Timestamp:
Sep 18, 2010, 11:06:03 PM (11 years ago)
Author:
charles
Message:

(trunk) #3547 "Wrong speed display in web UI" -- fixed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/utils.c

    r11209 r11228  
    5151
    5252#include "transmission.h"
     53#include "bencode.h"
    5354#include "fdlimit.h"
    5455#include "ConvertUTF.h"
     
    16871688    return formatter_get_size_str( &mem_units, buf, bytes_per_second, buflen );
    16881689}
     1690
     1691void
     1692tr_formatter_get_units( tr_benc * d )
     1693{
     1694    int i;
     1695    tr_benc * l;
     1696
     1697    tr_bencDictReserve( d, 6 );
     1698
     1699    tr_bencDictAddInt( d, "memory-bytes", mem_units.units[TR_FMT_KB].value );
     1700    l = tr_bencDictAddList( d, "memory-units", 4 );
     1701    for( i=0; i<4; i++ ) tr_bencListAddStr( l, mem_units.units[i].name );
     1702
     1703    tr_bencDictAddInt( d, "size-bytes",   size_units.units[TR_FMT_KB].value );
     1704    l = tr_bencDictAddList( d, "size-units", 4 );
     1705    for( i=0; i<4; i++ ) tr_bencListAddStr( l, size_units.units[i].name );
     1706
     1707    tr_bencDictAddInt( d, "speed-bytes",  speed_units.units[TR_FMT_KB].value );
     1708    l = tr_bencDictAddList( d, "speed-units", 4 );
     1709    for( i=0; i<4; i++ ) tr_bencListAddStr( l, speed_units.units[i].name );
     1710}
     1711
Note: See TracChangeset for help on using the changeset viewer.