From 8d254af2b85aba3f2c62734f6f56bf2d6820253f Mon Sep 17 00:00:00 2001 From: Jordan Lee Date: Fri, 15 Jul 2011 02:17:33 +0000 Subject: [PATCH] (trunk qt) #4357 "Wrong torrent count on tracker filterbar" -- handle special case described @ https://trac.transmissionbt.com/ticket/4357#comment:5 --- qt/filterbar.cc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/qt/filterbar.cc b/qt/filterbar.cc index 05600140a..2b0c002e0 100644 --- a/qt/filterbar.cc +++ b/qt/filterbar.cc @@ -309,18 +309,18 @@ FilterBar :: refreshTrackers( ) break; const Torrent * tor = index.data( TorrentModel::TorrentRole ).value(); const QStringList trackers = tor->trackers( ); - QSet torrentHosts; + QSet torrentNames; foreach( QString tracker, trackers ) { const QString host = Favicons::getHost( QUrl( tracker ) ); if( host.isEmpty( ) ) qWarning() << "torrent" << qPrintable(tor->name()) << "has an invalid announce URL:" << tracker; - else - torrentHosts.insert( host ); - } - foreach( QString host, torrentHosts ) { - newHosts.insert( host ); - ++torrentsPerHost[ readableHostName( host ) ]; + else { + newHosts.insert( host ); + torrentNames.insert( readableHostName( host ) ); + } } + foreach( QString name, torrentNames ) + ++torrentsPerHost[ name ]; } // update the "All" row -- 2.40.0