Changeset 12549


Ignore:
Timestamp:
Jul 15, 2011, 2:17:33 AM (10 years ago)
Author:
jordan
Message:

(trunk qt) #4357 "Wrong torrent count on tracker filterbar" -- handle special case described @ https://trac.transmissionbt.com/ticket/4357#comment:5

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/qt/filterbar.cc

    r12547 r12549  
    310310        const Torrent * tor = index.data( TorrentModel::TorrentRole ).value<const Torrent*>();
    311311        const QStringList trackers = tor->trackers( );
    312         QSet<QString> torrentHosts;
     312        QSet<QString> torrentNames;
    313313        foreach( QString tracker, trackers ) {
    314314            const QString host = Favicons::getHost( QUrl( tracker ) );
    315315            if( host.isEmpty( ) )
    316316                qWarning() << "torrent" << qPrintable(tor->name()) << "has an invalid announce URL:" << tracker;
    317             else
    318                 torrentHosts.insert( host );
    319         }
    320         foreach( QString host, torrentHosts ) {
    321             newHosts.insert( host );
    322             ++torrentsPerHost[ readableHostName( host ) ];
    323         }
     317            else {
     318                newHosts.insert( host );
     319                torrentNames.insert( readableHostName( host ) );
     320            }
     321        }
     322        foreach( QString name, torrentNames )
     323            ++torrentsPerHost[ name ];
    324324    }
    325325
Note: See TracChangeset for help on using the changeset viewer.