Merge pull request #3329 from glassez/state

Fix missing torrent states. Closes #3302.
This commit is contained in:
sledgehammer999 2015-07-03 21:58:57 +03:00
commit 2e0c3f8751
4 changed files with 22 additions and 1 deletions

View file

@ -109,6 +109,10 @@ QString TorrentState::toString() const
return QLatin1String("checkingDL");
case ForcedDownloading:
return QLatin1String("forcedDL");
case QueuedForChecking:
return QLatin1String("queuedForChecking");
case CheckingResumeData:
return QLatin1String("checkingResumeData");
default:
return QLatin1String("unknown");
}
@ -776,9 +780,13 @@ void TorrentHandle::updateState()
case libt::torrent_status::allocating:
m_state = TorrentState::Allocating;
break;
case libt::torrent_status::checking_files:
case libt::torrent_status::queued_for_checking:
m_state = TorrentState::QueuedForChecking;
break;
case libt::torrent_status::checking_resume_data:
m_state = TorrentState::CheckingResumeData;
break;
case libt::torrent_status::checking_files:
m_state = m_hasSeedStatus ? TorrentState::CheckingUploading : TorrentState::CheckingDownloading;
break;
case libt::torrent_status::downloading_metadata:

View file

@ -134,6 +134,9 @@ namespace BitTorrent
CheckingUploading,
CheckingDownloading,
QueuedForChecking,
CheckingResumeData,
PausedDownloading,
PausedUploading,

View file

@ -333,6 +333,8 @@ QIcon getIconByState(BitTorrent::TorrentState state)
return getQueuedIcon();
case BitTorrent::TorrentState::CheckingDownloading:
case BitTorrent::TorrentState::CheckingUploading:
case BitTorrent::TorrentState::QueuedForChecking:
case BitTorrent::TorrentState::CheckingResumeData:
return getCheckingIcon();
case BitTorrent::TorrentState::Unknown:
case BitTorrent::TorrentState::Error:
@ -378,6 +380,8 @@ QColor getColorByState(BitTorrent::TorrentState state)
case BitTorrent::TorrentState::QueuedUploading:
case BitTorrent::TorrentState::CheckingDownloading:
case BitTorrent::TorrentState::CheckingUploading:
case BitTorrent::TorrentState::QueuedForChecking:
case BitTorrent::TorrentState::CheckingResumeData:
return QColor(0, 128, 128); // Teal
case BitTorrent::TorrentState::Unknown:
return QColor(255, 0, 0); // red

View file

@ -123,6 +123,12 @@ void TransferListDelegate::paint(QPainter * painter, const QStyleOptionViewItem
case BitTorrent::TorrentState::CheckingUploading:
display = tr("Checking", "Torrent local data is being checked");
break;
case BitTorrent::TorrentState::QueuedForChecking:
display = tr("Queued for checking", "i.e. torrent is queued for hash checking");
break;
case BitTorrent::TorrentState::CheckingResumeData:
display = tr("Checking resume data", "used when loading the torrents from disk after qbt is launched. It checks the correctness of the .fastresume file. Normally it is completed in a fraction of a second, unless loading many many torrents.");
break;
case BitTorrent::TorrentState::PausedDownloading:
display = tr("Paused");
break;