Hide zero and infinity values in peer list only when that setting is set to Always

PR #22205.
Closes #21998.
This commit is contained in:
thalieht
2025-01-27 08:40:44 +02:00
committed by GitHub
parent 3978137534
commit bb4a668ddd

View File

@@ -420,7 +420,8 @@ void PeerListWidget::loadPeers(const BitTorrent::Torrent *torrent)
for (auto i = m_peerItems.cbegin(); i != m_peerItems.cend(); ++i)
existingPeers.insert(i.key());
const bool hideZeroValues = Preferences::instance()->getHideZeroValues();
const Preferences *pref = Preferences::instance();
const bool hideZeroValues = (pref->getHideZeroValues() && (pref->getHideZeroComboValues() == 0));
for (const BitTorrent::PeerInfo &peer : peers)
{
const PeerEndpoint peerEndpoint {peer.address(), peer.connectionType()};