mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-30 11:38:50 -07:00
Show rechecking progress
When having big torrents, the rechecking might take a while to complete. Users need some sort of feedback that progress is being made. Also, I changed the float to qreal since that's the return type.
This commit is contained in:
parent
e5c73cee4a
commit
375b15727d
3 changed files with 13 additions and 9 deletions
|
@ -519,15 +519,19 @@ int TorrentHandle::piecesHave() const
|
||||||
|
|
||||||
qreal TorrentHandle::progress() const
|
qreal TorrentHandle::progress() const
|
||||||
{
|
{
|
||||||
|
if (!isChecking()) {
|
||||||
if (!m_nativeStatus.total_wanted)
|
if (!m_nativeStatus.total_wanted)
|
||||||
return 0.;
|
return 0.;
|
||||||
|
|
||||||
if (m_nativeStatus.total_wanted_done == m_nativeStatus.total_wanted)
|
if (m_nativeStatus.total_wanted_done == m_nativeStatus.total_wanted)
|
||||||
return 1.;
|
return 1.;
|
||||||
|
|
||||||
float progress = static_cast<float>(m_nativeStatus.total_wanted_done) / m_nativeStatus.total_wanted;
|
qreal progress = static_cast<qreal>(m_nativeStatus.total_wanted_done) / m_nativeStatus.total_wanted;
|
||||||
Q_ASSERT((progress >= 0.f) && (progress <= 1.f));
|
Q_ASSERT((progress >= 0.f) && (progress <= 1.f));
|
||||||
return progress;
|
return progress;
|
||||||
|
}
|
||||||
|
|
||||||
|
return m_nativeStatus.progress;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString TorrentHandle::category() const
|
QString TorrentHandle::category() const
|
||||||
|
|
|
@ -327,7 +327,7 @@ namespace
|
||||||
// Each value of the 'torrents' dictionary contains map. The map can contain following keys:
|
// Each value of the 'torrents' dictionary contains map. The map can contain following keys:
|
||||||
// - "name": Torrent name
|
// - "name": Torrent name
|
||||||
// - "size": Torrent size
|
// - "size": Torrent size
|
||||||
// - "progress: Torrent progress
|
// - "progress": Torrent progress
|
||||||
// - "dlspeed": Torrent download speed
|
// - "dlspeed": Torrent download speed
|
||||||
// - "upspeed": Torrent upload speed
|
// - "upspeed": Torrent upload speed
|
||||||
// - "priority": Torrent priority (-1 if queuing is disabled)
|
// - "priority": Torrent priority (-1 if queuing is disabled)
|
||||||
|
|
|
@ -132,7 +132,7 @@ namespace
|
||||||
// - "hash": Torrent hash
|
// - "hash": Torrent hash
|
||||||
// - "name": Torrent name
|
// - "name": Torrent name
|
||||||
// - "size": Torrent size
|
// - "size": Torrent size
|
||||||
// - "progress: Torrent progress
|
// - "progress": Torrent progress
|
||||||
// - "dlspeed": Torrent download speed
|
// - "dlspeed": Torrent download speed
|
||||||
// - "upspeed": Torrent upload speed
|
// - "upspeed": Torrent upload speed
|
||||||
// - "priority": Torrent priority (-1 if queuing is disabled)
|
// - "priority": Torrent priority (-1 if queuing is disabled)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue