mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-02-06 11:54:18 +00:00
Fix possible transfer list refresh issue
This commit is contained in:
parent
1875846326
commit
3664134e02
@ -56,7 +56,7 @@
|
|||||||
#include "qinisettings.h"
|
#include "qinisettings.h"
|
||||||
|
|
||||||
TransferListWidget::TransferListWidget(QWidget *parent, GUI *main_window, QBtSession *_BTSession):
|
TransferListWidget::TransferListWidget(QWidget *parent, GUI *main_window, QBtSession *_BTSession):
|
||||||
QTreeView(parent), BTSession(_BTSession), main_window(main_window) {
|
QTreeView(parent), BTSession(_BTSession), main_window(main_window) {
|
||||||
QIniSettings settings("qBittorrent", "qBittorrent");
|
QIniSettings settings("qBittorrent", "qBittorrent");
|
||||||
// Create and apply delegate
|
// Create and apply delegate
|
||||||
listDelegate = new TransferListDelegate(this);
|
listDelegate = new TransferListDelegate(this);
|
||||||
@ -371,8 +371,11 @@ int TransferListWidget::updateTorrent(int row) {
|
|||||||
if(!isColumnHidden(TR_DLLIMIT))
|
if(!isColumnHidden(TR_DLLIMIT))
|
||||||
listModel->setData(listModel->index(row, TR_DLLIMIT), QVariant((qlonglong)h.download_limit()));
|
listModel->setData(listModel->index(row, TR_DLLIMIT), QVariant((qlonglong)h.download_limit()));
|
||||||
// Queueing code
|
// Queueing code
|
||||||
if(!h.is_seed() && BTSession->isQueueingEnabled()) {
|
if(BTSession->isQueueingEnabled()) {
|
||||||
listModel->setData(listModel->index(row, TR_PRIORITY), QVariant((int)h.queue_position()));
|
if(h.is_seed())
|
||||||
|
listModel->setData(listModel->index(row, TR_PRIORITY), -1);
|
||||||
|
else
|
||||||
|
listModel->setData(listModel->index(row, TR_PRIORITY), QVariant((int)h.queue_position()));
|
||||||
if(h.is_queued()) {
|
if(h.is_queued()) {
|
||||||
if(h.state() == torrent_status::checking_files || h.state() == torrent_status::queued_for_checking) {
|
if(h.state() == torrent_status::checking_files || h.state() == torrent_status::queued_for_checking) {
|
||||||
listModel->setData(listModel->index(row, TR_PROGRESS), QVariant((double)h.progress()));
|
listModel->setData(listModel->index(row, TR_PROGRESS), QVariant((double)h.progress()));
|
||||||
@ -383,7 +386,7 @@ int TransferListWidget::updateTorrent(int row) {
|
|||||||
}
|
}
|
||||||
listModel->setData(listModel->index(row, TR_NAME), QVariant(QIcon(QString::fromUtf8(":/Icons/skin/checking.png"))), Qt::DecorationRole);
|
listModel->setData(listModel->index(row, TR_NAME), QVariant(QIcon(QString::fromUtf8(":/Icons/skin/checking.png"))), Qt::DecorationRole);
|
||||||
listModel->setData(listModel->index(row, TR_STATUS), s);
|
listModel->setData(listModel->index(row, TR_STATUS), s);
|
||||||
}else {
|
} else {
|
||||||
listModel->setData(listModel->index(row, TR_ETA), QVariant((qlonglong)MAX_ETA));
|
listModel->setData(listModel->index(row, TR_ETA), QVariant((qlonglong)MAX_ETA));
|
||||||
if(h.is_seed()) {
|
if(h.is_seed()) {
|
||||||
s = STATE_QUEUED_UP;
|
s = STATE_QUEUED_UP;
|
||||||
@ -535,13 +538,13 @@ void TransferListWidget::refreshList(bool force) {
|
|||||||
case STATE_CHECKING_DL:
|
case STATE_CHECKING_DL:
|
||||||
case STATE_PAUSED_DL:
|
case STATE_PAUSED_DL:
|
||||||
case STATE_QUEUED_DL: {
|
case STATE_QUEUED_DL: {
|
||||||
if(s == STATE_PAUSED_DL) {
|
if(s == STATE_PAUSED_DL) {
|
||||||
++nb_paused;
|
++nb_paused;
|
||||||
}
|
|
||||||
++nb_inactive;
|
|
||||||
++nb_downloading;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
++nb_inactive;
|
||||||
|
++nb_downloading;
|
||||||
|
break;
|
||||||
|
}
|
||||||
case STATE_SEEDING:
|
case STATE_SEEDING:
|
||||||
++nb_active;
|
++nb_active;
|
||||||
++nb_seeding;
|
++nb_seeding;
|
||||||
@ -550,13 +553,13 @@ void TransferListWidget::refreshList(bool force) {
|
|||||||
case STATE_CHECKING_UP:
|
case STATE_CHECKING_UP:
|
||||||
case STATE_PAUSED_UP:
|
case STATE_PAUSED_UP:
|
||||||
case STATE_QUEUED_UP: {
|
case STATE_QUEUED_UP: {
|
||||||
if(s == STATE_PAUSED_UP) {
|
if(s == STATE_PAUSED_UP) {
|
||||||
++nb_paused;
|
++nb_paused;
|
||||||
}
|
|
||||||
++nb_seeding;
|
|
||||||
++nb_inactive;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
++nb_seeding;
|
||||||
|
++nb_inactive;
|
||||||
|
break;
|
||||||
|
}
|
||||||
case STATE_INVALID:
|
case STATE_INVALID:
|
||||||
bad_hashes << getHashFromRow(i);
|
bad_hashes << getHashFromRow(i);
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user