mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-30 08:24:22 +00:00
Fix possible transfer list refresh issue
This commit is contained in:
parent
1875846326
commit
3664134e02
@ -56,7 +56,7 @@
|
||||
#include "qinisettings.h"
|
||||
|
||||
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");
|
||||
// Create and apply delegate
|
||||
listDelegate = new TransferListDelegate(this);
|
||||
@ -371,8 +371,11 @@ int TransferListWidget::updateTorrent(int row) {
|
||||
if(!isColumnHidden(TR_DLLIMIT))
|
||||
listModel->setData(listModel->index(row, TR_DLLIMIT), QVariant((qlonglong)h.download_limit()));
|
||||
// Queueing code
|
||||
if(!h.is_seed() && BTSession->isQueueingEnabled()) {
|
||||
listModel->setData(listModel->index(row, TR_PRIORITY), QVariant((int)h.queue_position()));
|
||||
if(BTSession->isQueueingEnabled()) {
|
||||
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.state() == torrent_status::checking_files || h.state() == torrent_status::queued_for_checking) {
|
||||
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_STATUS), s);
|
||||
}else {
|
||||
} else {
|
||||
listModel->setData(listModel->index(row, TR_ETA), QVariant((qlonglong)MAX_ETA));
|
||||
if(h.is_seed()) {
|
||||
s = STATE_QUEUED_UP;
|
||||
@ -535,13 +538,13 @@ void TransferListWidget::refreshList(bool force) {
|
||||
case STATE_CHECKING_DL:
|
||||
case STATE_PAUSED_DL:
|
||||
case STATE_QUEUED_DL: {
|
||||
if(s == STATE_PAUSED_DL) {
|
||||
++nb_paused;
|
||||
}
|
||||
++nb_inactive;
|
||||
++nb_downloading;
|
||||
break;
|
||||
if(s == STATE_PAUSED_DL) {
|
||||
++nb_paused;
|
||||
}
|
||||
++nb_inactive;
|
||||
++nb_downloading;
|
||||
break;
|
||||
}
|
||||
case STATE_SEEDING:
|
||||
++nb_active;
|
||||
++nb_seeding;
|
||||
@ -550,13 +553,13 @@ void TransferListWidget::refreshList(bool force) {
|
||||
case STATE_CHECKING_UP:
|
||||
case STATE_PAUSED_UP:
|
||||
case STATE_QUEUED_UP: {
|
||||
if(s == STATE_PAUSED_UP) {
|
||||
++nb_paused;
|
||||
}
|
||||
++nb_seeding;
|
||||
++nb_inactive;
|
||||
break;
|
||||
if(s == STATE_PAUSED_UP) {
|
||||
++nb_paused;
|
||||
}
|
||||
++nb_seeding;
|
||||
++nb_inactive;
|
||||
break;
|
||||
}
|
||||
case STATE_INVALID:
|
||||
bad_hashes << getHashFromRow(i);
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user