Browse Source

Merge pull request #3329 from glassez/state

Fix missing torrent states. Closes #3302.
adaptive-webui-19844
sledgehammer999 9 years ago
parent
commit
2e0c3f8751
  1. 10
      src/core/bittorrent/torrenthandle.cpp
  2. 3
      src/core/bittorrent/torrenthandle.h
  3. 4
      src/gui/torrentmodel.cpp
  4. 6
      src/gui/transferlistdelegate.cpp

10
src/core/bittorrent/torrenthandle.cpp

@ -109,6 +109,10 @@ QString TorrentState::toString() const @@ -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() @@ -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:

3
src/core/bittorrent/torrenthandle.h

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

4
src/gui/torrentmodel.cpp

@ -333,6 +333,8 @@ QIcon getIconByState(BitTorrent::TorrentState state) @@ -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) @@ -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

6
src/gui/transferlistdelegate.cpp

@ -123,6 +123,12 @@ void TransferListDelegate::paint(QPainter * painter, const QStyleOptionViewItem @@ -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;

Loading…
Cancel
Save