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 Vladimir Golovnev (glassez)
parent f39e066672
commit 69321f0e94
No known key found for this signature in database
GPG key ID: 52A2C7DEE2DFA6F7

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()};