1
mirror of https://github.com/qbittorrent/qBittorrent synced 2024-10-19 21:36:47 +02:00

Fix coding style

This commit is contained in:
Chocobo1 2020-11-29 20:06:30 +08:00
parent 8f2cdcef0e
commit 4381739b6d
No known key found for this signature in database
GPG Key ID: 210D9C873253A68C

View File

@ -112,23 +112,21 @@ QString TorrentContentModelItem::displayData(const int column) const
case COL_NAME:
return m_name;
case COL_PRIO:
{
switch (m_priority)
{
case BitTorrent::DownloadPriority::Mixed:
return tr("Mixed", "Mixed (priorities");
case BitTorrent::DownloadPriority::Ignored:
return tr("Not downloaded");
case BitTorrent::DownloadPriority::High:
return tr("High", "High (priority)");
case BitTorrent::DownloadPriority::Maximum:
return tr("Maximum", "Maximum (priority)");
default:
return tr("Normal", "Normal (priority)");
}
switch (m_priority)
{
case BitTorrent::DownloadPriority::Mixed:
return tr("Mixed", "Mixed (priorities");
case BitTorrent::DownloadPriority::Ignored:
return tr("Not downloaded");
case BitTorrent::DownloadPriority::High:
return tr("High", "High (priority)");
case BitTorrent::DownloadPriority::Maximum:
return tr("Maximum", "Maximum (priority)");
default:
return tr("Normal", "Normal (priority)");
}
case COL_PROGRESS:
{
{
const qreal progress = m_progress * 100;
return (static_cast<int>(progress) == 100)
? QString::fromLatin1("100%")
@ -139,7 +137,7 @@ QString TorrentContentModelItem::displayData(const int column) const
case COL_REMAINING:
return Utils::Misc::friendlyUnit(remaining());
case COL_AVAILABILITY:
{
{
const qreal avail = availability();
if (avail < 0)
return tr("N/A");
@ -147,7 +145,7 @@ QString TorrentContentModelItem::displayData(const int column) const
const QString value = (avail >= 1)
? QString::fromLatin1("100")
: Utils::String::fromDouble((avail * 100), 1);
return QString {value + C_THIN_SPACE + QLatin1Char('%')};
return {value + C_THIN_SPACE + QLatin1Char('%')};
}
default:
Q_ASSERT(false);