mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-21 05:43:32 -07:00
Add metadata check and address PR comments.
This commit is contained in:
parent
22e139d48d
commit
44b0a59fde
1 changed files with 5 additions and 1 deletions
|
@ -194,7 +194,7 @@ QVariant TransferListModel::headerData(const int section, const Qt::Orientation
|
|||
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("% Selected", "Percentage of torrent selected");
|
||||
case TR_PERCENT_SELECTED: return tr("% Selected Data", "Percentage of selected data to download.");
|
||||
default: return {};
|
||||
}
|
||||
}
|
||||
|
@ -445,6 +445,8 @@ QString TransferListModel::displayValue(const BitTorrent::Torrent *torrent, cons
|
|||
case TR_PRIVATE:
|
||||
return privateString(torrent->isPrivate(), torrent->hasMetadata());
|
||||
case TR_PERCENT_SELECTED:
|
||||
if (!torrent->hasMetadata())
|
||||
return tr("N/A");
|
||||
return QString::number((torrent->wantedSize() * 100) / torrent->totalSize()) + u'%';
|
||||
}
|
||||
|
||||
|
@ -530,6 +532,8 @@ QVariant TransferListModel::internalValue(const BitTorrent::Torrent *torrent, co
|
|||
case TR_PRIVATE:
|
||||
return (torrent->hasMetadata() ? torrent->isPrivate() : QVariant());
|
||||
case TR_PERCENT_SELECTED:
|
||||
if (!torrent->hasMetadata())
|
||||
return 0;
|
||||
return (torrent->wantedSize() * 100) / torrent->totalSize();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue