Changeset 13195


Ignore:
Timestamp:
Feb 3, 2012, 9:21:52 PM (7 years ago)
Author:
jordan
Message:

(trunk) use base-10 units for network bandwidth (ie, speed) and disk sizes.

It looks like the Mac client is already doing this and it's clearly the trend in other apps as well. Even apt-get is using kB/s, ferchrissake... :)

Flame away.

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/cli/cli.c

    r13191 r13195  
    4545#define MEM_T_STR "TiB"
    4646
    47 #define DISK_K 1024
     47#define DISK_K 1000
    4848#define DISK_B_STR   "B"
    49 #define DISK_K_STR "KiB"
    50 #define DISK_M_STR "MiB"
    51 #define DISK_G_STR "GiB"
    52 #define DISK_T_STR "TiB"
    53 
    54 #define SPEED_K 1024
    55 #define SPEED_B_STR   "B/s"
    56 #define SPEED_K_STR "KiB/s"
    57 #define SPEED_M_STR "MiB/s"
    58 #define SPEED_G_STR "GiB/s"
    59 #define SPEED_T_STR "TiB/s"
     49#define DISK_K_STR "kB"
     50#define DISK_M_STR "MB"
     51#define DISK_G_STR "GB"
     52#define DISK_T_STR "TB"
     53
     54#define SPEED_K 1000
     55#define SPEED_B_STR  "B/s"
     56#define SPEED_K_STR "kB/s"
     57#define SPEED_M_STR "MB/s"
     58#define SPEED_G_STR "GB/s"
     59#define SPEED_T_STR "TB/s"
    6060
    6161/***
  • trunk/daemon/daemon.c

    r12476 r13195  
    4444#define MEM_T_STR "TiB"
    4545
    46 #define DISK_K 1024
    47 #define DISK_B_STR   "B"
    48 #define DISK_K_STR "KiB"
    49 #define DISK_M_STR "MiB"
    50 #define DISK_G_STR "GiB"
    51 #define DISK_T_STR "TiB"
    52 
    53 #define SPEED_K 1024
    54 #define SPEED_B_STR   "B/s"
    55 #define SPEED_K_STR "KiB/s"
    56 #define SPEED_M_STR "MiB/s"
    57 #define SPEED_G_STR "GiB/s"
    58 #define SPEED_T_STR "TiB/s"
     46#define DISK_K 1000
     47#define DISK_B_STR  "B"
     48#define DISK_K_STR "kB"
     49#define DISK_M_STR "MB"
     50#define DISK_G_STR "GB"
     51#define DISK_T_STR "TB"
     52
     53#define SPEED_K 1000
     54#define SPEED_B_STR  "B/s"
     55#define SPEED_K_STR "kB/s"
     56#define SPEED_M_STR "MB/s"
     57#define SPEED_G_STR "GB/s"
     58#define SPEED_T_STR "TB/s"
    5959
    6060static bool paused = false;
  • trunk/daemon/remote.c

    r13182 r13195  
    5252#define MEM_T_STR "TiB"
    5353
    54 #define DISK_K 1024
    55 #define DISK_B_STR   "B"
    56 #define DISK_K_STR "KiB"
    57 #define DISK_M_STR "MiB"
    58 #define DISK_G_STR "GiB"
    59 #define DISK_T_STR "TiB"
    60 
    61 #define SPEED_K 1024
    62 #define SPEED_B_STR   "B/s"
    63 #define SPEED_K_STR "KiB/s"
    64 #define SPEED_M_STR "MiB/s"
    65 #define SPEED_G_STR "GiB/s"
    66 #define SPEED_T_STR "TiB/s"
     54#define DISK_K 1000
     55#define DISK_B_STR  "B"
     56#define DISK_K_STR "kB"
     57#define DISK_M_STR "MB"
     58#define DISK_G_STR "GB"
     59#define DISK_T_STR "TB"
     60
     61#define SPEED_K 1000
     62#define SPEED_B_STR  "B/s"
     63#define SPEED_K_STR "kB/s"
     64#define SPEED_M_STR "MB/s"
     65#define SPEED_G_STR "GB/s"
     66#define SPEED_T_STR "TB/s"
    6767
    6868/***
  • trunk/gtk/tr-window.c

    r12970 r13195  
    734734        int w=0, h=0;
    735735        PangoLayout * pango_layout;
    736         pango_layout = gtk_widget_create_pango_layout( p->ul_lb, "999.99 KiB/s" );
     736        pango_layout = gtk_widget_create_pango_layout( p->ul_lb, "999.99 kB/s" );
    737737        pango_layout_get_pixel_size( pango_layout, &w, &h );
    738738        gtk_widget_set_size_request( p->ul_lb, w, h );
  • trunk/gtk/util.c

    r13179 r13195  
    4141const char * mem_T_str = N_("TiB");
    4242
    43 const int disk_K = 1024;
    44 const char * disk_K_str = N_("KiB");
    45 const char * disk_M_str = N_("MiB");
    46 const char * disk_G_str = N_("GiB");
    47 const char * disk_T_str = N_("TiB");
    48 
    49 const int speed_K = 1024;
    50 const char * speed_K_str = N_("KiB/s");
    51 const char * speed_M_str = N_("MiB/s");
    52 const char * speed_G_str = N_("GiB/s");
    53 const char * speed_T_str = N_("TiB/s");
     43const int disk_K = 1000;
     44const char * disk_K_str = N_("kB");
     45const char * disk_M_str = N_("MB");
     46const char * disk_G_str = N_("GB");
     47const char * disk_T_str = N_("TB");
     48
     49const int speed_K = 1000;
     50const char * speed_K_str = N_("kB/s");
     51const char * speed_M_str = N_("MB/s");
     52const char * speed_G_str = N_("GB/s");
     53const char * speed_T_str = N_("TB/s");
    5454
    5555/***
  • trunk/qt/formatter.cc

    r12429 r13195  
    3535Formatter :: initUnits( )
    3636{
    37     speed_K = 1024;
    38     unitStrings[SPEED][B]  = tr(   "B/s" );
    39     unitStrings[SPEED][KB] = tr( "KiB/s" );
    40     unitStrings[SPEED][MB] = tr( "MiB/s" );
    41     unitStrings[SPEED][GB] = tr( "GiB/s" );
    42     unitStrings[SPEED][TB] = tr( "TiB/s" );
     37    speed_K = 1000;
     38    unitStrings[SPEED][B]  = tr(  "B/s" );
     39    unitStrings[SPEED][KB] = tr( "kB/s" );
     40    unitStrings[SPEED][MB] = tr( "MB/s" );
     41    unitStrings[SPEED][GB] = tr( "GB/s" );
     42    unitStrings[SPEED][TB] = tr( "TB/s" );
    4343    tr_formatter_speed_init( speed_K,
    4444                             qPrintable( unitStrings[SPEED][KB] ),
     
    4747                             qPrintable( unitStrings[SPEED][TB] ) );
    4848
    49     size_K = 1024;
    50     unitStrings[SIZE][B]  = tr(   "B" );
    51     unitStrings[SIZE][KB] = tr( "KiB" );
    52     unitStrings[SIZE][MB] = tr( "MiB" );
    53     unitStrings[SIZE][GB] = tr( "GiB" );
    54     unitStrings[SIZE][TB] = tr( "TiB" );
     49    size_K = 1000;
     50    unitStrings[SIZE][B]  = tr(  "B" );
     51    unitStrings[SIZE][KB] = tr( "kB" );
     52    unitStrings[SIZE][MB] = tr( "MB" );
     53    unitStrings[SIZE][GB] = tr( "GB" );
     54    unitStrings[SIZE][TB] = tr( "TB" );
    5555    tr_formatter_size_init( size_K,
    5656                            qPrintable( unitStrings[SIZE][KB] ),
  • trunk/utils/show.c

    r12225 r13195  
    3737#define MEM_T_STR "TiB"
    3838
    39 #define DISK_K 1024
    40 #define DISK_B_STR "B"
    41 #define DISK_K_STR "KiB"
    42 #define DISK_M_STR "MiB"
    43 #define DISK_G_STR "GiB"
    44 #define DISK_T_STR "TiB"
    45 
    46 #define SPEED_K 1024
    47 #define SPEED_B_STR "B/s"
    48 #define SPEED_K_STR "KiB/s"
    49 #define SPEED_M_STR "MiB/s"
    50 #define SPEED_G_STR "GiB/s"
    51 #define SPEED_T_STR "TiB/s"
     39#define DISK_K 1000
     40#define DISK_B_STR  "B"
     41#define DISK_K_STR "kB"
     42#define DISK_M_STR "MB"
     43#define DISK_G_STR "GB"
     44#define DISK_T_STR "TB"
     45
     46#define SPEED_K 1000
     47#define SPEED_B_STR  "B/s"
     48#define SPEED_K_STR "kB/s"
     49#define SPEED_M_STR "MB/s"
     50#define SPEED_G_STR "GB/s"
     51#define SPEED_T_STR "TB/s"
    5252
    5353static tr_option options[] =
  • trunk/web/javascript/formatter.js

    r13194 r13195  
    1515        var speed_T_str = 'TB/s';
    1616
    17         var size_K = 1024;
     17        var size_K = 1000;
    1818        var size_B_str =  'B';
    19         var size_K_str = 'KB';
     19        var size_K_str = 'kB';
    2020        var size_M_str = 'MB';
    2121        var size_G_str = 'GB';
     
    2323
    2424        var mem_K = 1024;
    25         var mem_B_str =  'B';
    26         var mem_K_str = 'KB';
    27         var mem_M_str = 'MB';
    28         var mem_G_str = 'GB';
    29         var mem_T_str = 'TB';
     25        var mem_B_str =   'B';
     26        var mem_K_str = 'KiB';
     27        var mem_M_str = 'MiB';
     28        var mem_G_str = 'GiB';
     29        var mem_T_str = 'TiB';
    3030
    3131        return {
Note: See TracChangeset for help on using the changeset viewer.