From 61aa4d9f1c930f8f31a233124a9d03e7e3bbd4c3 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Sun, 29 Nov 2020 20:06:30 +0800 Subject: [PATCH] Fix coding style --- src/gui/torrentcontentmodelitem.cpp | 32 ++++++++++++++--------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/src/gui/torrentcontentmodelitem.cpp b/src/gui/torrentcontentmodelitem.cpp index d84c33ae1..71c58b8d7 100644 --- a/src/gui/torrentcontentmodelitem.cpp +++ b/src/gui/torrentcontentmodelitem.cpp @@ -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(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);