mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-15 01:33:07 -07:00
- Removed workaround for getting progress of paused torrents, apparently it works
This commit is contained in:
parent
afbfe1a96d
commit
c97bce4d61
4 changed files with 3 additions and 29 deletions
|
@ -756,25 +756,6 @@ void bittorrent::loadFilesPriorities(QTorrentHandle &h) {
|
|||
h.prioritize_files(v);
|
||||
}
|
||||
|
||||
float bittorrent::getUncheckedTorrentProgress(QString hash) const {
|
||||
QFile paused_file(misc::qBittorrentPath()+"BT_backup"+QDir::separator()+hash+".paused");
|
||||
paused_file.open(QIODevice::ReadOnly | QIODevice::Text);
|
||||
if(!paused_file.exists()) {
|
||||
return 0.;
|
||||
}
|
||||
QByteArray progress_char = paused_file.readAll();
|
||||
qDebug("Read progress: %s", (const char*)progress_char.data());
|
||||
paused_file.close();
|
||||
bool ok = false;
|
||||
float progress = progress_char.toFloat(&ok);
|
||||
if(!ok) {
|
||||
qDebug("Error converting progress in .paused file!");
|
||||
return 0.;
|
||||
}
|
||||
qDebug("Unchecked torrent progress is %f", progress);
|
||||
return progress;
|
||||
}
|
||||
|
||||
float bittorrent::getRealRatio(QString hash) const{
|
||||
QTorrentHandle h = getTorrentHandle(hash);
|
||||
Q_ASSERT(h.all_time_download() >= 0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue