Merge pull request #4062 from glassez/speedup

Some TransferListWidget speedup.
This commit is contained in:
sledgehammer999 2015-11-13 11:14:43 -06:00
commit 84f6a82d98
6 changed files with 37 additions and 41 deletions

View file

@ -67,7 +67,7 @@ TorrentModel::TorrentModel(QObject *parent)
// Listen for torrent changes
connect(BitTorrent::Session::instance(), SIGNAL(torrentAdded(BitTorrent::TorrentHandle *const)), SLOT(addTorrent(BitTorrent::TorrentHandle *const)));
connect(BitTorrent::Session::instance(), SIGNAL(torrentAboutToBeRemoved(BitTorrent::TorrentHandle *const)), SLOT(handleTorrentAboutToBeRemoved(BitTorrent::TorrentHandle *const)));
connect(BitTorrent::Session::instance(), SIGNAL(torrentStatusUpdated(BitTorrent::TorrentHandle *const)), this, SLOT(handleTorrentStatusUpdated(BitTorrent::TorrentHandle *const)));
connect(BitTorrent::Session::instance(), SIGNAL(torrentsUpdated()), SLOT(handleTorrentsUpdated()));
connect(BitTorrent::Session::instance(), SIGNAL(torrentFinished(BitTorrent::TorrentHandle *const)), SLOT(handleTorrentStatusUpdated(BitTorrent::TorrentHandle *const)));
connect(BitTorrent::Session::instance(), SIGNAL(torrentMetadataLoaded(BitTorrent::TorrentHandle *const)), SLOT(handleTorrentStatusUpdated(BitTorrent::TorrentHandle *const)));
@ -307,6 +307,11 @@ void TorrentModel::handleTorrentStatusUpdated(BitTorrent::TorrentHandle *const t
emit dataChanged(index(row, 0), index(row, columnCount() - 1));
}
void TorrentModel::handleTorrentsUpdated()
{
emit dataChanged(index(0, 0), index(rowCount() - 1, columnCount() - 1));
}
// Static functions
QIcon getIconByState(BitTorrent::TorrentState state)