|
|
@ -325,6 +325,8 @@ void TransferListModel::handleTorrentStatusUpdated(BitTorrent::TorrentHandle *co |
|
|
|
void TransferListModel::handleTorrentsUpdated(const QVector<BitTorrent::TorrentHandle *> &torrents) |
|
|
|
void TransferListModel::handleTorrentsUpdated(const QVector<BitTorrent::TorrentHandle *> &torrents) |
|
|
|
{ |
|
|
|
{ |
|
|
|
const int columns = (columnCount() - 1); |
|
|
|
const int columns = (columnCount() - 1); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (torrents.size() <= (m_torrentList.size() * 0.5)) { |
|
|
|
for (BitTorrent::TorrentHandle *const torrent : torrents) { |
|
|
|
for (BitTorrent::TorrentHandle *const torrent : torrents) { |
|
|
|
const int row = m_torrentMap.value(torrent, -1); |
|
|
|
const int row = m_torrentMap.value(torrent, -1); |
|
|
|
|
|
|
|
|
|
|
@ -333,6 +335,11 @@ void TransferListModel::handleTorrentsUpdated(const QVector<BitTorrent::TorrentH |
|
|
|
|
|
|
|
|
|
|
|
emit dataChanged(index(row, 0), index(row, columns)); |
|
|
|
emit dataChanged(index(row, 0), index(row, columns)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
// save the overhead when more than half of the torrent list needs update
|
|
|
|
|
|
|
|
emit dataChanged(index(0, 0), index((rowCount() - 1), columns)); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Static functions
|
|
|
|
// Static functions
|
|
|
|