Itr cache

This commit is contained in:
BotanEgg
2012-07-14 06:28:23 +08:00
parent ae09bee193
commit bb11d11a72
9 changed files with 118 additions and 58 deletions

View File

@@ -122,8 +122,10 @@ qlonglong TorrentSpeedMonitor::getETA(const QString &hash) const
void TorrentSpeedMonitor::getSamples()
{
const std::vector<torrent_handle> torrents = m_session->getSession()->get_torrents();
std::vector<torrent_handle>::const_iterator it;
for (it = torrents.begin(); it != torrents.end(); ++it) {
std::vector<torrent_handle>::const_iterator it = torrents.begin();
std::vector<torrent_handle>::const_iterator itend = torrents.end();
for ( ; it != itend; ++it) {
try {
#if LIBTORRENT_VERSION_MINOR > 15
torrent_status st = it->status(0x0);