1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-22 07:42:37 +00:00

feat(qt): Add ETA to compact view (#3926)

* feat(qt): Add ETA to compcat view

* style: Apply codestyle guides

* fix: Remove whitespaces from translatable string

* chore: fix FTBFS from 76521a1 code shear

---------

Co-authored-by: Charles Kerr <charles@charleskerr.com>
This commit is contained in:
Federico Scodelaro 2023-12-16 13:32:07 -03:00 committed by GitHub
parent e951ed2508
commit 33c4cd1c44
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -308,6 +308,27 @@ QString TorrentDelegate::shortStatusString(Torrent const& tor)
break;
}
// add time when downloading
auto const seed_ratio_limit = tor.getSeedRatioLimit();
if ((seed_ratio_limit && tor.isSeeding()) || tor.isDownloading())
{
if (tor.hasETA())
{
//: Second (optional) part of torrent progress string,
//: %1 is duration,
//: notice that leading space (before the dash) is included here
str += QStringLiteral(" ");
str += tr("%1 left").arg(Formatter::time_to_string(tor.getETA()));
}
else
{
//: Second (optional) part of torrent progress string,
//: notice that leading space (before the dash) is included here
str += QStringLiteral(" ");
str += tr("Remaining time unknown");
}
}
return str.trimmed();
}