mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-19 06:57:24 -06:00
Call updateTorrentNumbers() once per every model refresh, not once for every row changed
Torrent numbers were recalculated on every dataChanged() signal. The previous commit
greatly increases the number of dataChanged() signals.
HEAD^^:
Total wall clock: 97.069s
updateTorrentNumbers() time: 0.033s
HEAD^:
Total wall clock: 96.132s
updateTorrentNumbers() time: 0.179s
HEAD:
Total wall clock: 95.535s
updateTorrentNumbers() time: 0.047s
After this commit the time of updateTorrentNumbers() is (almost) back to
the level that it was in HEAD^^.
This commit is contained in:
@@ -595,6 +595,8 @@ void TorrentModel::stateUpdated(const std::vector<libtorrent::torrent_status> &s
|
|||||||
notifyTorrentChanged(row);
|
notifyTorrentChanged(row);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
emit modelRefreshed();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TorrentModel::inhibitSystem()
|
bool TorrentModel::inhibitSystem()
|
||||||
|
|||||||
@@ -101,6 +101,7 @@ signals:
|
|||||||
void torrentAdded(TorrentModelItem *torrentItem);
|
void torrentAdded(TorrentModelItem *torrentItem);
|
||||||
void torrentAboutToBeRemoved(TorrentModelItem *torrentItem);
|
void torrentAboutToBeRemoved(TorrentModelItem *torrentItem);
|
||||||
void torrentChangedLabel(TorrentModelItem *torrentItem, QString previous, QString current);
|
void torrentChangedLabel(TorrentModelItem *torrentItem, QString previous, QString current);
|
||||||
|
void modelRefreshed();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void addTorrent(const QTorrentHandle& h);
|
void addTorrent(const QTorrentHandle& h);
|
||||||
|
|||||||
@@ -203,7 +203,7 @@ TransferListFiltersWidget::TransferListFiltersWidget(QWidget *parent, TransferLi
|
|||||||
|
|
||||||
// SIGNAL/SLOT
|
// SIGNAL/SLOT
|
||||||
connect(statusFilters, SIGNAL(currentRowChanged(int)), transferList, SLOT(applyStatusFilter(int)));
|
connect(statusFilters, SIGNAL(currentRowChanged(int)), transferList, SLOT(applyStatusFilter(int)));
|
||||||
connect(transferList->getSourceModel(), SIGNAL(dataChanged(QModelIndex,QModelIndex)), SLOT(updateTorrentNumbers()));
|
connect(transferList->getSourceModel(), SIGNAL(modelRefreshed()), SLOT(updateTorrentNumbers()));
|
||||||
connect(transferList->getSourceModel(), SIGNAL(torrentAdded(TorrentModelItem*)), SLOT(handleNewTorrent(TorrentModelItem*)));
|
connect(transferList->getSourceModel(), SIGNAL(torrentAdded(TorrentModelItem*)), SLOT(handleNewTorrent(TorrentModelItem*)));
|
||||||
connect(labelFilters, SIGNAL(currentRowChanged(int)), this, SLOT(applyLabelFilter(int)));
|
connect(labelFilters, SIGNAL(currentRowChanged(int)), this, SLOT(applyLabelFilter(int)));
|
||||||
connect(labelFilters, SIGNAL(torrentDropped(int)), this, SLOT(torrentDropped(int)));
|
connect(labelFilters, SIGNAL(torrentDropped(int)), this, SLOT(torrentDropped(int)));
|
||||||
|
|||||||
Reference in New Issue
Block a user