mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-11 07:18:08 +00:00
Correctly update the total number of torrents when a torrent is automatically removed
This commit is contained in:
parent
071801fee7
commit
080a36de5f
@ -141,6 +141,7 @@ TransferListWidget::TransferListWidget(QWidget *parent, GUI *main_window, QBtSes
|
|||||||
connect(BTSession, SIGNAL(pausedTorrent(QTorrentHandle&)), this, SLOT(pauseTorrent(QTorrentHandle&)));
|
connect(BTSession, SIGNAL(pausedTorrent(QTorrentHandle&)), this, SLOT(pauseTorrent(QTorrentHandle&)));
|
||||||
connect(BTSession, SIGNAL(resumedTorrent(QTorrentHandle&)), this, SLOT(resumeTorrent(QTorrentHandle&)));
|
connect(BTSession, SIGNAL(resumedTorrent(QTorrentHandle&)), this, SLOT(resumeTorrent(QTorrentHandle&)));
|
||||||
connect(BTSession, SIGNAL(torrentFinishedChecking(QTorrentHandle&)), this, SLOT(updateMetadata(QTorrentHandle&)));
|
connect(BTSession, SIGNAL(torrentFinishedChecking(QTorrentHandle&)), this, SLOT(updateMetadata(QTorrentHandle&)));
|
||||||
|
connect(BTSession, SIGNAL(deletedTorrent(QString)), SLOT(deleteTorrent(QString)));
|
||||||
|
|
||||||
// Listen for list events
|
// Listen for list events
|
||||||
connect(this, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(torrentDoubleClicked(QModelIndex)));
|
connect(this, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(torrentDoubleClicked(QModelIndex)));
|
||||||
@ -256,6 +257,13 @@ void TransferListWidget::pauseTorrent(QTorrentHandle &h) {
|
|||||||
pauseTorrent(getRowFromHash(h.hash()));
|
pauseTorrent(getRowFromHash(h.hash()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TransferListWidget::deleteTorrent(QString hash) {
|
||||||
|
const int row = getRowFromHash(hash);
|
||||||
|
if(row >= 0) {
|
||||||
|
deleteTorrent(row, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void TransferListWidget::pauseTorrent(int row, bool refresh_list) {
|
void TransferListWidget::pauseTorrent(int row, bool refresh_list) {
|
||||||
const QTorrentHandle h = BTSession->getTorrentHandle(getHashFromRow(row));
|
const QTorrentHandle h = BTSession->getTorrentHandle(getHashFromRow(row));
|
||||||
listModel->setData(listModel->index(row, TR_DLSPEED), QVariant((double)0.0));
|
listModel->setData(listModel->index(row, TR_DLSPEED), QVariant((double)0.0));
|
||||||
|
@ -103,6 +103,7 @@ protected:
|
|||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
int updateTorrent(int row);
|
int updateTorrent(int row);
|
||||||
|
void deleteTorrent(QString hash);
|
||||||
void deleteTorrent(int row, bool refresh_list=true);
|
void deleteTorrent(int row, bool refresh_list=true);
|
||||||
void pauseTorrent(int row, bool refresh_list=true);
|
void pauseTorrent(int row, bool refresh_list=true);
|
||||||
void resumeTorrent(int row, bool refresh_list=true);
|
void resumeTorrent(int row, bool refresh_list=true);
|
||||||
|
Loading…
Reference in New Issue
Block a user