1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-11 07:18:08 +00:00

React again to finished torrents when previously unselected files have finished downloading.

This commit is contained in:
sledgehammer999 2015-10-25 02:40:26 +03:00
parent bfd30dcabc
commit f74c68e121

View File

@ -1766,6 +1766,17 @@ void TorrentHandle::prioritizeFiles(const QVector<int> &priorities)
qDebug() << Q_FUNC_INFO;
if (priorities.size() != filesCount()) return;
// Reset 'm_hasSeedStatus' if needed in order to react again to
// 'torrent_finished_alert' and eg show tray notifications
QVector<qreal> progress = filesProgress();
QVector<int> oldPriorities = filePriorities();
for (int i = 0; i < oldPriorities.size(); ++i) {
if ((oldPriorities[i] == 0) && (priorities[i] > 0) && (progress[i] < 1.0)) {
m_hasSeedStatus = false;
break;
}
}
qDebug() << Q_FUNC_INFO << "Changing files priorities...";
SAFE_CALL(prioritize_files, priorities.toStdVector());