mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-23 08:48:07 -06:00
Add preliminary support of libtorrent v1.2
libtorrent v1.2 should be built with deprecated features enabled.
This commit is contained in:
@@ -109,10 +109,10 @@ void TorrentContentModelFolder::updatePriority()
|
||||
// If all children have the same priority
|
||||
// then the folder should have the same
|
||||
// priority
|
||||
const BitTorrent::FilePriority prio = m_childItems.first()->priority();
|
||||
const BitTorrent::DownloadPriority prio = m_childItems.first()->priority();
|
||||
for (int i = 1; i < m_childItems.size(); ++i) {
|
||||
if (m_childItems.at(i)->priority() != prio) {
|
||||
setPriority(BitTorrent::FilePriority::Mixed);
|
||||
setPriority(BitTorrent::DownloadPriority::Mixed);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -121,7 +121,7 @@ void TorrentContentModelFolder::updatePriority()
|
||||
setPriority(prio);
|
||||
}
|
||||
|
||||
void TorrentContentModelFolder::setPriority(BitTorrent::FilePriority newPriority, bool updateParent)
|
||||
void TorrentContentModelFolder::setPriority(BitTorrent::DownloadPriority newPriority, bool updateParent)
|
||||
{
|
||||
if (m_priority == newPriority)
|
||||
return;
|
||||
@@ -133,7 +133,7 @@ void TorrentContentModelFolder::setPriority(BitTorrent::FilePriority newPriority
|
||||
m_parentItem->updatePriority();
|
||||
|
||||
// Update children
|
||||
if (m_priority != BitTorrent::FilePriority::Mixed)
|
||||
if (m_priority != BitTorrent::DownloadPriority::Mixed)
|
||||
for (TorrentContentModelItem *child : asConst(m_childItems))
|
||||
child->setPriority(m_priority, false);
|
||||
}
|
||||
@@ -144,7 +144,7 @@ void TorrentContentModelFolder::recalculateProgress()
|
||||
qulonglong tSize = 0;
|
||||
qulonglong tRemaining = 0;
|
||||
for (TorrentContentModelItem *child : asConst(m_childItems)) {
|
||||
if (child->priority() == BitTorrent::FilePriority::Ignored)
|
||||
if (child->priority() == BitTorrent::DownloadPriority::Ignored)
|
||||
continue;
|
||||
|
||||
if (child->itemType() == FolderType)
|
||||
@@ -167,7 +167,7 @@ void TorrentContentModelFolder::recalculateAvailability()
|
||||
qulonglong tSize = 0;
|
||||
bool foundAnyData = false;
|
||||
for (TorrentContentModelItem *child : asConst(m_childItems)) {
|
||||
if (child->priority() == BitTorrent::FilePriority::Ignored)
|
||||
if (child->priority() == BitTorrent::DownloadPriority::Ignored)
|
||||
continue;
|
||||
|
||||
if (child->itemType() == FolderType)
|
||||
|
||||
Reference in New Issue
Block a user