mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-16 02:03:07 -07:00
Show 'N/A' when there is no hash
This is to follow 'General' tab which show 'N/A' when there is no hash.
This commit is contained in:
parent
ce7d8dee28
commit
66795d533a
1 changed files with 9 additions and 2 deletions
|
@ -374,6 +374,13 @@ QString TransferListModel::displayValue(const BitTorrent::Torrent *torrent, cons
|
||||||
: m_statusStrings[state];
|
: m_statusStrings[state];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const auto hashString = [hideValues](const auto &hash) -> QString
|
||||||
|
{
|
||||||
|
if (hideValues && !hash.isValid())
|
||||||
|
return {};
|
||||||
|
return hash.isValid() ? hash.toString() : tr("N/A");
|
||||||
|
};
|
||||||
|
|
||||||
switch (column)
|
switch (column)
|
||||||
{
|
{
|
||||||
case TR_NAME:
|
case TR_NAME:
|
||||||
|
@ -441,9 +448,9 @@ QString TransferListModel::displayValue(const BitTorrent::Torrent *torrent, cons
|
||||||
case TR_TOTAL_SIZE:
|
case TR_TOTAL_SIZE:
|
||||||
return unitString(torrent->totalSize());
|
return unitString(torrent->totalSize());
|
||||||
case TR_INFOHASH_V1:
|
case TR_INFOHASH_V1:
|
||||||
return torrent->infoHash().v1().toString();
|
return hashString(torrent->infoHash().v1());
|
||||||
case TR_INFOHASH_V2:
|
case TR_INFOHASH_V2:
|
||||||
return torrent->infoHash().v2().toString();
|
return hashString(torrent->infoHash().v2());
|
||||||
}
|
}
|
||||||
|
|
||||||
return {};
|
return {};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue