mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-23 08:48:07 -06:00
Replace prio namespace with FilePriority enum class
This commit is contained in:
@@ -108,10 +108,10 @@ void TorrentContentModelFolder::updatePriority()
|
||||
// If all children have the same priority
|
||||
// then the folder should have the same
|
||||
// priority
|
||||
const int prio = m_childItems.first()->priority();
|
||||
const BitTorrent::FilePriority prio = m_childItems.first()->priority();
|
||||
for (int i = 1; i < m_childItems.size(); ++i) {
|
||||
if (m_childItems.at(i)->priority() != prio) {
|
||||
setPriority(prio::MIXED);
|
||||
setPriority(BitTorrent::FilePriority::Mixed);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -120,7 +120,7 @@ void TorrentContentModelFolder::updatePriority()
|
||||
setPriority(prio);
|
||||
}
|
||||
|
||||
void TorrentContentModelFolder::setPriority(int newPriority, bool updateParent)
|
||||
void TorrentContentModelFolder::setPriority(BitTorrent::FilePriority newPriority, bool updateParent)
|
||||
{
|
||||
if (m_priority == newPriority)
|
||||
return;
|
||||
@@ -132,7 +132,7 @@ void TorrentContentModelFolder::setPriority(int newPriority, bool updateParent)
|
||||
m_parentItem->updatePriority();
|
||||
|
||||
// Update children
|
||||
if (m_priority != prio::MIXED)
|
||||
if (m_priority != BitTorrent::FilePriority::Mixed)
|
||||
for (TorrentContentModelItem *child : asConst(m_childItems))
|
||||
child->setPriority(m_priority, false);
|
||||
}
|
||||
@@ -143,7 +143,7 @@ void TorrentContentModelFolder::recalculateProgress()
|
||||
qulonglong tSize = 0;
|
||||
qulonglong tRemaining = 0;
|
||||
for (TorrentContentModelItem *child : asConst(m_childItems)) {
|
||||
if (child->priority() == prio::IGNORED)
|
||||
if (child->priority() == BitTorrent::FilePriority::Ignored)
|
||||
continue;
|
||||
|
||||
if (child->itemType() == FolderType)
|
||||
@@ -166,7 +166,7 @@ void TorrentContentModelFolder::recalculateAvailability()
|
||||
qulonglong tSize = 0;
|
||||
bool foundAnyData = false;
|
||||
for (TorrentContentModelItem *child : asConst(m_childItems)) {
|
||||
if (child->priority() == prio::IGNORED)
|
||||
if (child->priority() == BitTorrent::FilePriority::Ignored)
|
||||
continue;
|
||||
|
||||
if (child->itemType() == FolderType)
|
||||
|
||||
Reference in New Issue
Block a user