mirror of
https://github.com/transmission/transmission
synced 2024-12-25 01:03:01 +00:00
(trunk libT) #1800: Display glitch in "transmission-daemon -l" when all files in a torrent are disabled
This commit is contained in:
parent
65bba3fdfb
commit
7026258127
1 changed files with 14 additions and 3 deletions
|
@ -198,7 +198,12 @@ addFiles( tr_benc * args,
|
|||
}
|
||||
if( strcmp( arg, "all" ) )
|
||||
{
|
||||
tr_rpc_parse_list_str( files, arg, strlen( arg ) );
|
||||
int i;
|
||||
int valueCount;
|
||||
int * values = tr_parseNumberRange( arg, -1, &valueCount );
|
||||
for( i=0; i<valueCount; ++i )
|
||||
tr_bencListAddInt( files, values[i] );
|
||||
tr_free( values );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1101,6 +1106,12 @@ printTorrentList( tr_benc * top )
|
|||
char statusStr[64];
|
||||
char ratioStr[32];
|
||||
char haveStr[32];
|
||||
char doneStr[8];
|
||||
|
||||
if( sizeWhenDone )
|
||||
tr_snprintf( doneStr, sizeof( doneStr ), "%d%%", (int)( 100.0 * ( sizeWhenDone - leftUntilDone ) / sizeWhenDone ) );
|
||||
else
|
||||
tr_strlcpy( doneStr, "n/a", sizeof( doneStr ) );
|
||||
|
||||
strlsize( haveStr, sizeWhenDone - leftUntilDone, sizeof( haveStr ) );
|
||||
|
||||
|
@ -1109,9 +1120,9 @@ printTorrentList( tr_benc * top )
|
|||
else
|
||||
tr_snprintf( etaStr, sizeof( etaStr ), "Done" );
|
||||
printf(
|
||||
"%4d %3d%% %9s %-8s %6.1f %6.1f %5s %-11s %s\n",
|
||||
"%4d %4s %9s %-8s %6.1f %6.1f %5s %-11s %s\n",
|
||||
(int)id,
|
||||
(int)( 100.0 * ( sizeWhenDone - leftUntilDone ) / sizeWhenDone ),
|
||||
doneStr,
|
||||
haveStr,
|
||||
etaStr,
|
||||
up / 1024.0,
|
||||
|
|
Loading…
Reference in a new issue