mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-07 13:41:26 -07:00
Better on-demand reloading of torrent data
This commit is contained in:
parent
d639c16f72
commit
1f3bf75fff
4 changed files with 18 additions and 5 deletions
|
@ -315,9 +315,18 @@ void TransferListModel::handleTorrentStatusUpdated(BitTorrent::TorrentHandle *co
|
|||
emit dataChanged(index(row, 0), index(row, columnCount() - 1));
|
||||
}
|
||||
|
||||
void TransferListModel::handleTorrentsUpdated()
|
||||
void TransferListModel::handleTorrentsUpdated(const QVector<BitTorrent::TorrentHandle *> &torrents)
|
||||
{
|
||||
emit dataChanged(index(0, 0), index(rowCount() - 1, columnCount() - 1));
|
||||
const int columns = (columnCount() - 1);
|
||||
|
||||
for (BitTorrent::TorrentHandle *const torrent : torrents) {
|
||||
const int row = m_torrents.indexOf(torrent);
|
||||
|
||||
if (row < 0)
|
||||
continue;
|
||||
|
||||
emit dataChanged(index(row, 0), index(row, columns));
|
||||
}
|
||||
}
|
||||
|
||||
// Static functions
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue