mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-19 21:03:30 -07:00
fix issues pointed out in PR.
* Multiple space in `js` left over after "linting"-it * Wrap percent + % symbol in brackets in order to separate it from the default value. * Multiple occurrences of unsorted `case` statements.
This commit is contained in:
parent
631197c446
commit
489ed9bcdc
3 changed files with 7 additions and 7 deletions
|
@ -193,8 +193,8 @@ QVariant TransferListModel::headerData(const int section, const Qt::Orientation
|
|||
case TR_INFOHASH_V1: return tr("Info Hash v1", "i.e: torrent info hash v1");
|
||||
case TR_INFOHASH_V2: return tr("Info Hash v2", "i.e: torrent info hash v2");
|
||||
case TR_REANNOUNCE: return tr("Reannounce In", "Indicates the time until next trackers reannounce");
|
||||
case TR_PRIVATE: return tr("Private", "Flags private torrents");
|
||||
case TR_PERCENT_SELECTED: return tr("%", "Percentage of selected data to download");
|
||||
case TR_PRIVATE: return tr("Private", "Flags private torrents");
|
||||
default: return {};
|
||||
}
|
||||
}
|
||||
|
@ -443,10 +443,10 @@ QString TransferListModel::displayValue(const BitTorrent::Torrent *torrent, cons
|
|||
return hashString(torrent->infoHash().v2());
|
||||
case TR_REANNOUNCE:
|
||||
return reannounceString(torrent->nextAnnounce());
|
||||
case TR_PERCENT_SELECTED:
|
||||
return torrent->hasMetadata() ? (QString::number((static_cast<qreal>(torrent->wantedSize()) * 100) / torrent->totalSize(), 'f', 2) + u'%') : tr("N/A");
|
||||
case TR_PRIVATE:
|
||||
return privateString(torrent->isPrivate(), torrent->hasMetadata());
|
||||
case TR_PERCENT_SELECTED:
|
||||
return torrent->hasMetadata() ? QString::number((static_cast<qreal>(torrent->wantedSize()) * 100) / torrent->totalSize(), 'f', 2) + u'%' : tr("N/A");
|
||||
}
|
||||
|
||||
return {};
|
||||
|
@ -531,7 +531,7 @@ QVariant TransferListModel::internalValue(const BitTorrent::Torrent *torrent, co
|
|||
case TR_PRIVATE:
|
||||
return (torrent->hasMetadata() ? torrent->isPrivate() : QVariant());
|
||||
case TR_PERCENT_SELECTED:
|
||||
return torrent->hasMetadata() ? (static_cast<qreal>(torrent->wantedSize()) * 100) / torrent->totalSize() : 0;
|
||||
return torrent->hasMetadata() ? ((static_cast<qreal>(torrent->wantedSize()) * 100) / torrent->totalSize()) : 0;
|
||||
}
|
||||
|
||||
return {};
|
||||
|
|
|
@ -204,11 +204,11 @@ int TransferListSortModel::compare(const QModelIndex &left, const QModelIndex &r
|
|||
return customCompare(leftValue.toLongLong(), rightValue.toLongLong());
|
||||
|
||||
case TransferListModel::TR_AVAILABILITY:
|
||||
case TransferListModel::TR_PERCENT_SELECTED:
|
||||
case TransferListModel::TR_POPULARITY:
|
||||
case TransferListModel::TR_PROGRESS:
|
||||
case TransferListModel::TR_RATIO:
|
||||
case TransferListModel::TR_RATIO_LIMIT:
|
||||
case TransferListModel::TR_PERCENT_SELECTED:
|
||||
case TransferListModel::TR_POPULARITY:
|
||||
return customCompare(leftValue.toReal(), rightValue.toReal());
|
||||
|
||||
case TransferListModel::TR_STATUS:
|
||||
|
|
|
@ -1564,7 +1564,7 @@ window.qBittorrent.DynamicTable ??= (() => {
|
|||
td.title = "QBT_TR(N/A)QBT_TR[CONTEXT=TrackerListWidget]";
|
||||
return;
|
||||
}
|
||||
const value = `${window.qBittorrent.Misc.toFixedPointString(percent, 2) }%`;
|
||||
const value = `${window.qBittorrent.Misc.toFixedPointString(percent, 2)}%`;
|
||||
td.textContent = value;
|
||||
td.title = value;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue