Use helper function to construct QString

This is shorter and avoids the need of 2 constructors.
This commit is contained in:
Chocobo1 2020-03-16 20:48:59 +08:00
parent 6c307774f1
commit b7e7d8019c
No known key found for this signature in database
GPG key ID: 210D9C873253A68C
7 changed files with 9 additions and 9 deletions

View file

@ -292,7 +292,7 @@ QString TransferListModel::displayValue(const BitTorrent::TorrentHandle *torrent
{
progress *= 100;
return (static_cast<int>(progress) == 100)
? QString {QLatin1String {"100%"}}
? QString::fromLatin1("100%")
: Utils::String::fromDouble(progress, 1) + '%';
};