1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-03-10 14:13:23 +00:00

widen the torrent-id column for cleaner formatting (#840)

Under the current code, if there are over 9,999 torrents the
format will shift over one space when bumping from 9999 to 10000.
This commit is contained in:
Charles Kerr 2019-02-18 22:39:02 +00:00 committed by GitHub
parent 309d97c578
commit 3cf3d6a22a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1446,7 +1446,7 @@ static void printTorrentList(tr_variant* top)
double total_down = 0;
char haveStr[32];
printf("%-4s %-4s %9s %-8s %6s %6s %-5s %-11s %s\n", "ID", "Done", "Have", "ETA", "Up", "Down", "Ratio",
printf("%6s %-4s %9s %-8s %6s %6s %-5s %-11s %s\n", "ID", "Done", "Have", "ETA", "Up", "Down", "Ratio",
"Status", "Name");
for (int i = 0, n = tr_variantListSize(list); i < n; ++i)
@ -1508,7 +1508,7 @@ static void printTorrentList(tr_variant* top)
errorMark = ' ';
}
printf("%4d%c %4s %9s %-8s %6.1f %6.1f %5s %-11s %s\n", (int)id, errorMark, doneStr, haveStr, etaStr,
printf("%6d%c %4s %9s %-8s %6.1f %6.1f %5s %-11s %s\n", (int)id, errorMark, doneStr, haveStr, etaStr,
up / (double)tr_speed_K, down / (double)tr_speed_K, strlratio2(ratioStr, ratio, sizeof(ratioStr)),
getStatusString(d, statusStr, sizeof(statusStr)), name);
@ -1518,7 +1518,7 @@ static void printTorrentList(tr_variant* top)
}
}
printf("Sum: %9s %6.1f %6.1f\n", strlsize(haveStr, total_size, sizeof(haveStr)),
printf("Sum: %9s %6.1f %6.1f\n", strlsize(haveStr, total_size, sizeof(haveStr)),
total_up / (double)tr_speed_K, total_down / (double)tr_speed_K);
}
}