mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-22 16:37:21 -06:00
Add preliminary support of libtorrent v1.2
libtorrent v1.2 should be built with deprecated features enabled.
This commit is contained in:
@@ -37,7 +37,7 @@
|
||||
#include <QUrl>
|
||||
#include <QVector>
|
||||
|
||||
#include "base/bittorrent/filepriority.h"
|
||||
#include "base/bittorrent/downloadpriority.h"
|
||||
#include "base/bittorrent/magneturi.h"
|
||||
#include "base/bittorrent/session.h"
|
||||
#include "base/bittorrent/torrenthandle.h"
|
||||
@@ -420,10 +420,10 @@ void AddNewTorrentDialog::updateDiskSpaceLabel()
|
||||
|
||||
if (m_hasMetadata) {
|
||||
if (m_contentModel) {
|
||||
const QVector<int> priorities = m_contentModel->model()->getFilePriorities();
|
||||
const QVector<BitTorrent::DownloadPriority> priorities = m_contentModel->model()->getFilePriorities();
|
||||
Q_ASSERT(priorities.size() == m_torrentInfo.filesCount());
|
||||
for (int i = 0; i < priorities.size(); ++i)
|
||||
if (priorities[i] > 0)
|
||||
if (priorities[i] > BitTorrent::DownloadPriority::Ignored)
|
||||
torrentSize += m_torrentInfo.fileSize(i);
|
||||
}
|
||||
else {
|
||||
@@ -612,13 +612,13 @@ void AddNewTorrentDialog::displayContentTreeMenu(const QPoint &)
|
||||
renameSelectedFile();
|
||||
}
|
||||
else {
|
||||
BitTorrent::FilePriority prio = BitTorrent::FilePriority::Normal;
|
||||
BitTorrent::DownloadPriority prio = BitTorrent::DownloadPriority::Normal;
|
||||
if (act == m_ui->actionHigh)
|
||||
prio = BitTorrent::FilePriority::High;
|
||||
prio = BitTorrent::DownloadPriority::High;
|
||||
else if (act == m_ui->actionMaximum)
|
||||
prio = BitTorrent::FilePriority::Maximum;
|
||||
prio = BitTorrent::DownloadPriority::Maximum;
|
||||
else if (act == m_ui->actionNotDownloaded)
|
||||
prio = BitTorrent::FilePriority::Ignored;
|
||||
prio = BitTorrent::DownloadPriority::Ignored;
|
||||
|
||||
qDebug("Setting files priority");
|
||||
for (const QModelIndex &index : selectedRows) {
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
#include <QThread>
|
||||
#include <QUrl>
|
||||
|
||||
#include "base/bittorrent/filepriority.h"
|
||||
#include "base/bittorrent/downloadpriority.h"
|
||||
#include "base/bittorrent/session.h"
|
||||
#include "base/preferences.h"
|
||||
#include "base/unicodestrings.h"
|
||||
@@ -621,13 +621,13 @@ void PropertiesWidget::displayFilesListMenu(const QPoint &)
|
||||
renameSelectedFile();
|
||||
}
|
||||
else {
|
||||
BitTorrent::FilePriority prio = BitTorrent::FilePriority::Normal;
|
||||
BitTorrent::DownloadPriority prio = BitTorrent::DownloadPriority::Normal;
|
||||
if (act == m_ui->actionHigh)
|
||||
prio = BitTorrent::FilePriority::High;
|
||||
prio = BitTorrent::DownloadPriority::High;
|
||||
else if (act == m_ui->actionMaximum)
|
||||
prio = BitTorrent::FilePriority::Maximum;
|
||||
prio = BitTorrent::DownloadPriority::Maximum;
|
||||
else if (act == m_ui->actionNotDownloaded)
|
||||
prio = BitTorrent::FilePriority::Ignored;
|
||||
prio = BitTorrent::DownloadPriority::Ignored;
|
||||
|
||||
qDebug("Setting files priority");
|
||||
for (const QModelIndex &index : selectedRows) {
|
||||
@@ -894,11 +894,7 @@ void PropertiesWidget::editWebSeed()
|
||||
|
||||
void PropertiesWidget::applyPriorities()
|
||||
{
|
||||
qDebug("Saving files priorities");
|
||||
const QVector<int> priorities = m_propListModel->model()->getFilePriorities();
|
||||
// Prioritize the files
|
||||
qDebug("prioritize files: %d", priorities[0]);
|
||||
m_torrent->prioritizeFiles(priorities);
|
||||
m_torrent->prioritizeFiles(m_propListModel->model()->getFilePriorities());
|
||||
}
|
||||
|
||||
void PropertiesWidget::filteredFilesChanged()
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
#include <QProxyStyle>
|
||||
#endif
|
||||
|
||||
#include "base/bittorrent/filepriority.h"
|
||||
#include "base/bittorrent/downloadpriority.h"
|
||||
#include "base/unicodestrings.h"
|
||||
#include "base/utils/misc.h"
|
||||
#include "base/utils/string.h"
|
||||
@@ -93,7 +93,7 @@ void PropListDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opti
|
||||
newopt.maximum = 100;
|
||||
newopt.minimum = 0;
|
||||
newopt.textVisible = true;
|
||||
if (index.sibling(index.row(), PRIORITY).data().toInt() == static_cast<int>(BitTorrent::FilePriority::Ignored)) {
|
||||
if (index.sibling(index.row(), PRIORITY).data().toInt() == static_cast<int>(BitTorrent::DownloadPriority::Ignored)) {
|
||||
newopt.state &= ~QStyle::State_Enabled;
|
||||
newopt.palette = progressBarDisabledPalette();
|
||||
}
|
||||
@@ -111,17 +111,17 @@ void PropListDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opti
|
||||
break;
|
||||
case PRIORITY: {
|
||||
QString text = "";
|
||||
switch (static_cast<BitTorrent::FilePriority>(index.data().toInt())) {
|
||||
case BitTorrent::FilePriority::Mixed:
|
||||
switch (static_cast<BitTorrent::DownloadPriority>(index.data().toInt())) {
|
||||
case BitTorrent::DownloadPriority::Mixed:
|
||||
text = tr("Mixed", "Mixed (priorities");
|
||||
break;
|
||||
case BitTorrent::FilePriority::Ignored:
|
||||
case BitTorrent::DownloadPriority::Ignored:
|
||||
text = tr("Not downloaded");
|
||||
break;
|
||||
case BitTorrent::FilePriority::High:
|
||||
case BitTorrent::DownloadPriority::High:
|
||||
text = tr("High", "High (priority)");
|
||||
break;
|
||||
case BitTorrent::FilePriority::Maximum:
|
||||
case BitTorrent::DownloadPriority::Maximum:
|
||||
text = tr("Maximum", "Maximum (priority)");
|
||||
break;
|
||||
default:
|
||||
@@ -155,14 +155,14 @@ void PropListDelegate::setEditorData(QWidget *editor, const QModelIndex &index)
|
||||
{
|
||||
auto *combobox = static_cast<QComboBox *>(editor);
|
||||
// Set combobox index
|
||||
switch (static_cast<BitTorrent::FilePriority>(index.data().toInt())) {
|
||||
case BitTorrent::FilePriority::Ignored:
|
||||
switch (static_cast<BitTorrent::DownloadPriority>(index.data().toInt())) {
|
||||
case BitTorrent::DownloadPriority::Ignored:
|
||||
combobox->setCurrentIndex(0);
|
||||
break;
|
||||
case BitTorrent::FilePriority::High:
|
||||
case BitTorrent::DownloadPriority::High:
|
||||
combobox->setCurrentIndex(2);
|
||||
break;
|
||||
case BitTorrent::FilePriority::Maximum:
|
||||
case BitTorrent::DownloadPriority::Maximum:
|
||||
combobox->setCurrentIndex(3);
|
||||
break;
|
||||
default:
|
||||
@@ -181,7 +181,7 @@ QWidget *PropListDelegate::createEditor(QWidget *parent, const QStyleOptionViewI
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (index.data().toInt() == static_cast<int>(BitTorrent::FilePriority::Mixed))
|
||||
if (index.data().toInt() == static_cast<int>(BitTorrent::DownloadPriority::Mixed))
|
||||
return nullptr;
|
||||
|
||||
auto *editor = new QComboBox(parent);
|
||||
@@ -199,16 +199,16 @@ void PropListDelegate::setModelData(QWidget *editor, QAbstractItemModel *model,
|
||||
int value = combobox->currentIndex();
|
||||
qDebug("PropListDelegate: setModelData(%d)", value);
|
||||
|
||||
BitTorrent::FilePriority prio = BitTorrent::FilePriority::Normal; // NORMAL
|
||||
BitTorrent::DownloadPriority prio = BitTorrent::DownloadPriority::Normal; // NORMAL
|
||||
switch (value) {
|
||||
case 0:
|
||||
prio = BitTorrent::FilePriority::Ignored; // IGNORED
|
||||
prio = BitTorrent::DownloadPriority::Ignored; // IGNORED
|
||||
break;
|
||||
case 2:
|
||||
prio = BitTorrent::FilePriority::High; // HIGH
|
||||
prio = BitTorrent::DownloadPriority::High; // HIGH
|
||||
break;
|
||||
case 3:
|
||||
prio = BitTorrent::FilePriority::Maximum; // MAX
|
||||
prio = BitTorrent::DownloadPriority::Maximum; // MAX
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -367,9 +367,9 @@ void TrackerListWidget::loadTrackers()
|
||||
}
|
||||
|
||||
item->setText(COL_PEERS, QString::number(data.numPeers));
|
||||
item->setText(COL_SEEDS, (entry.nativeEntry().scrape_complete > -1) ? QString::number(entry.nativeEntry().scrape_complete) : tr("N/A"));
|
||||
item->setText(COL_LEECHES, (entry.nativeEntry().scrape_incomplete > -1) ? QString::number(entry.nativeEntry().scrape_incomplete) : tr("N/A"));
|
||||
item->setText(COL_DOWNLOADED, (entry.nativeEntry().scrape_downloaded > -1) ? QString::number(entry.nativeEntry().scrape_downloaded) : tr("N/A"));
|
||||
item->setText(COL_SEEDS, (entry.numSeeds() > -1) ? QString::number(entry.numSeeds()) : tr("N/A"));
|
||||
item->setText(COL_LEECHES, (entry.numLeeches() > -1) ? QString::number(entry.numLeeches()) : tr("N/A"));
|
||||
item->setText(COL_DOWNLOADED, (entry.numDownloaded() > -1) ? QString::number(entry.numDownloaded()) : tr("N/A"));
|
||||
|
||||
item->setTextAlignment(COL_TIER, (Qt::AlignRight | Qt::AlignVCenter));
|
||||
item->setTextAlignment(COL_PEERS, (Qt::AlignRight | Qt::AlignVCenter));
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
#include <QPixmapCache>
|
||||
#endif
|
||||
|
||||
#include "base/bittorrent/filepriority.h"
|
||||
#include "base/bittorrent/downloadpriority.h"
|
||||
#include "base/global.h"
|
||||
#include "base/utils/misc.h"
|
||||
#include "base/utils/fs.h"
|
||||
@@ -239,7 +239,7 @@ void TorrentContentModel::updateFilesProgress(const QVector<qreal> &fp)
|
||||
emit dataChanged(index(0, 0), index(rowCount(), columnCount()));
|
||||
}
|
||||
|
||||
void TorrentContentModel::updateFilesPriorities(const QVector<int> &fprio)
|
||||
void TorrentContentModel::updateFilesPriorities(const QVector<BitTorrent::DownloadPriority> &fprio)
|
||||
{
|
||||
Q_ASSERT(m_filesIndex.size() == fprio.size());
|
||||
// XXX: Why is this necessary?
|
||||
@@ -248,7 +248,7 @@ void TorrentContentModel::updateFilesPriorities(const QVector<int> &fprio)
|
||||
|
||||
emit layoutAboutToBeChanged();
|
||||
for (int i = 0; i < fprio.size(); ++i)
|
||||
m_filesIndex[i]->setPriority(static_cast<BitTorrent::FilePriority>(fprio[i]));
|
||||
m_filesIndex[i]->setPriority(static_cast<BitTorrent::DownloadPriority>(fprio[i]));
|
||||
emit dataChanged(index(0, 0), index(rowCount(), columnCount()));
|
||||
}
|
||||
|
||||
@@ -266,12 +266,12 @@ void TorrentContentModel::updateFilesAvailability(const QVector<qreal> &fa)
|
||||
emit dataChanged(index(0, 0), index(rowCount(), columnCount()));
|
||||
}
|
||||
|
||||
QVector<int> TorrentContentModel::getFilePriorities() const
|
||||
QVector<BitTorrent::DownloadPriority> TorrentContentModel::getFilePriorities() const
|
||||
{
|
||||
QVector<int> prio;
|
||||
QVector<BitTorrent::DownloadPriority> prio;
|
||||
prio.reserve(m_filesIndex.size());
|
||||
for (const TorrentContentModelFile *file : asConst(m_filesIndex))
|
||||
prio.push_back(static_cast<int>(file->priority()));
|
||||
prio.push_back(file->priority());
|
||||
return prio;
|
||||
}
|
||||
|
||||
@@ -279,7 +279,7 @@ bool TorrentContentModel::allFiltered() const
|
||||
{
|
||||
return std::all_of(m_filesIndex.cbegin(), m_filesIndex.cend(), [](const TorrentContentModelFile *fileItem)
|
||||
{
|
||||
return (fileItem->priority() == BitTorrent::FilePriority::Ignored);
|
||||
return (fileItem->priority() == BitTorrent::DownloadPriority::Ignored);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -300,11 +300,11 @@ bool TorrentContentModel::setData(const QModelIndex &index, const QVariant &valu
|
||||
auto *item = static_cast<TorrentContentModelItem*>(index.internalPointer());
|
||||
qDebug("setData(%s, %d", qUtf8Printable(item->name()), value.toInt());
|
||||
if (static_cast<int>(item->priority()) != value.toInt()) {
|
||||
BitTorrent::FilePriority prio = BitTorrent::FilePriority::Normal;
|
||||
BitTorrent::DownloadPriority prio = BitTorrent::DownloadPriority::Normal;
|
||||
if (value.toInt() == Qt::PartiallyChecked)
|
||||
prio = BitTorrent::FilePriority::Mixed;
|
||||
prio = BitTorrent::DownloadPriority::Mixed;
|
||||
else if (value.toInt() == Qt::Unchecked)
|
||||
prio = BitTorrent::FilePriority::Ignored;
|
||||
prio = BitTorrent::DownloadPriority::Ignored;
|
||||
|
||||
item->setPriority(prio);
|
||||
// Update folders progress in the tree
|
||||
@@ -324,7 +324,7 @@ bool TorrentContentModel::setData(const QModelIndex &index, const QVariant &valu
|
||||
item->setName(value.toString());
|
||||
break;
|
||||
case TorrentContentModelItem::COL_PRIO:
|
||||
item->setPriority(static_cast<BitTorrent::FilePriority>(value.toInt()));
|
||||
item->setPriority(static_cast<BitTorrent::DownloadPriority>(value.toInt()));
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
@@ -366,9 +366,9 @@ QVariant TorrentContentModel::data(const QModelIndex &index, int role) const
|
||||
}
|
||||
|
||||
if ((index.column() == TorrentContentModelItem::COL_NAME) && (role == Qt::CheckStateRole)) {
|
||||
if (item->data(TorrentContentModelItem::COL_PRIO).toInt() == static_cast<int>(BitTorrent::FilePriority::Ignored))
|
||||
if (item->data(TorrentContentModelItem::COL_PRIO).toInt() == static_cast<int>(BitTorrent::DownloadPriority::Ignored))
|
||||
return Qt::Unchecked;
|
||||
if (item->data(TorrentContentModelItem::COL_PRIO).toInt() == static_cast<int>(BitTorrent::FilePriority::Mixed))
|
||||
if (item->data(TorrentContentModelItem::COL_PRIO).toInt() == static_cast<int>(BitTorrent::DownloadPriority::Mixed))
|
||||
return Qt::PartiallyChecked;
|
||||
return Qt::Checked;
|
||||
}
|
||||
@@ -503,8 +503,8 @@ void TorrentContentModel::selectAll()
|
||||
{
|
||||
for (int i = 0; i < m_rootItem->childCount(); ++i) {
|
||||
TorrentContentModelItem* child = m_rootItem->child(i);
|
||||
if (child->priority() == BitTorrent::FilePriority::Ignored)
|
||||
child->setPriority(BitTorrent::FilePriority::Normal);
|
||||
if (child->priority() == BitTorrent::DownloadPriority::Ignored)
|
||||
child->setPriority(BitTorrent::DownloadPriority::Normal);
|
||||
}
|
||||
emit dataChanged(index(0, 0), index(rowCount(), columnCount()));
|
||||
}
|
||||
@@ -512,6 +512,6 @@ void TorrentContentModel::selectAll()
|
||||
void TorrentContentModel::selectNone()
|
||||
{
|
||||
for (int i = 0; i < m_rootItem->childCount(); ++i)
|
||||
m_rootItem->child(i)->setPriority(BitTorrent::FilePriority::Ignored);
|
||||
m_rootItem->child(i)->setPriority(BitTorrent::DownloadPriority::Ignored);
|
||||
emit dataChanged(index(0, 0), index(rowCount(), columnCount()));
|
||||
}
|
||||
|
||||
@@ -43,15 +43,16 @@ class TorrentContentModelFile;
|
||||
class TorrentContentModel : public QAbstractItemModel
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_DISABLE_COPY(TorrentContentModel)
|
||||
|
||||
public:
|
||||
TorrentContentModel(QObject *parent = nullptr);
|
||||
~TorrentContentModel() override;
|
||||
|
||||
void updateFilesProgress(const QVector<qreal> &fp);
|
||||
void updateFilesPriorities(const QVector<int> &fprio);
|
||||
void updateFilesPriorities(const QVector<BitTorrent::DownloadPriority> &fprio);
|
||||
void updateFilesAvailability(const QVector<qreal> &fa);
|
||||
QVector<int> getFilePriorities() const;
|
||||
QVector<BitTorrent::DownloadPriority> getFilePriorities() const;
|
||||
bool allFiltered() const;
|
||||
int columnCount(const QModelIndex &parent = {}) const override;
|
||||
bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;
|
||||
|
||||
@@ -52,9 +52,9 @@ int TorrentContentModelFile::fileIndex() const
|
||||
return m_fileIndex;
|
||||
}
|
||||
|
||||
void TorrentContentModelFile::setPriority(BitTorrent::FilePriority newPriority, bool updateParent)
|
||||
void TorrentContentModelFile::setPriority(BitTorrent::DownloadPriority newPriority, bool updateParent)
|
||||
{
|
||||
Q_ASSERT(newPriority != BitTorrent::FilePriority::Mixed);
|
||||
Q_ASSERT(newPriority != BitTorrent::DownloadPriority::Mixed);
|
||||
|
||||
if (m_priority == newPriority)
|
||||
return;
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#ifndef TORRENTCONTENTMODELFILE_H
|
||||
#define TORRENTCONTENTMODELFILE_H
|
||||
|
||||
#include "base/bittorrent/filepriority.h"
|
||||
#include "base/bittorrent/downloadpriority.h"
|
||||
#include "torrentcontentmodelitem.h"
|
||||
|
||||
class TorrentContentModelFile : public TorrentContentModelItem
|
||||
@@ -39,7 +39,7 @@ public:
|
||||
TorrentContentModelFolder *parent, int fileIndex);
|
||||
|
||||
int fileIndex() const;
|
||||
void setPriority(BitTorrent::FilePriority newPriority, bool updateParent = true) override;
|
||||
void setPriority(BitTorrent::DownloadPriority newPriority, bool updateParent = true) override;
|
||||
void setProgress(qreal progress);
|
||||
void setAvailability(qreal availability);
|
||||
ItemType itemType() const override;
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#ifndef TORRENTCONTENTMODELFOLDER_H
|
||||
#define TORRENTCONTENTMODELFOLDER_H
|
||||
|
||||
#include "base/bittorrent/filepriority.h"
|
||||
#include "base/bittorrent/downloadpriority.h"
|
||||
#include "torrentcontentmodelitem.h"
|
||||
|
||||
class TorrentContentModelFolder : public TorrentContentModelItem
|
||||
@@ -50,7 +50,7 @@ public:
|
||||
void recalculateAvailability();
|
||||
void updatePriority();
|
||||
|
||||
void setPriority(BitTorrent::FilePriority newPriority, bool updateParent = true) override;
|
||||
void setPriority(BitTorrent::DownloadPriority newPriority, bool updateParent = true) override;
|
||||
|
||||
void deleteAllChildren();
|
||||
const QList<TorrentContentModelItem*> &children() const;
|
||||
|
||||
@@ -38,7 +38,7 @@ TorrentContentModelItem::TorrentContentModelItem(TorrentContentModelFolder *pare
|
||||
: m_parentItem(parent)
|
||||
, m_size(0)
|
||||
, m_remaining(0)
|
||||
, m_priority(BitTorrent::FilePriority::Normal)
|
||||
, m_priority(BitTorrent::DownloadPriority::Normal)
|
||||
, m_progress(0)
|
||||
, m_availability(-1.)
|
||||
{
|
||||
@@ -90,7 +90,7 @@ qreal TorrentContentModelItem::availability() const
|
||||
return (m_size > 0) ? m_availability : 0;
|
||||
}
|
||||
|
||||
BitTorrent::FilePriority TorrentContentModelItem::priority() const
|
||||
BitTorrent::DownloadPriority TorrentContentModelItem::priority() const
|
||||
{
|
||||
Q_ASSERT(!isRootItem());
|
||||
return m_priority;
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
#include <QList>
|
||||
#include <QVariant>
|
||||
|
||||
#include "base/bittorrent/filepriority.h"
|
||||
#include "base/bittorrent/downloadpriority.h"
|
||||
|
||||
class TorrentContentModelFolder;
|
||||
|
||||
@@ -72,8 +72,8 @@ public:
|
||||
|
||||
qreal availability() const;
|
||||
|
||||
BitTorrent::FilePriority priority() const;
|
||||
virtual void setPriority(BitTorrent::FilePriority newPriority, bool updateParent = true) = 0;
|
||||
BitTorrent::DownloadPriority priority() const;
|
||||
virtual void setPriority(BitTorrent::DownloadPriority newPriority, bool updateParent = true) = 0;
|
||||
|
||||
int columnCount() const;
|
||||
QVariant data(int column) const;
|
||||
@@ -87,7 +87,7 @@ protected:
|
||||
QString m_name;
|
||||
qulonglong m_size;
|
||||
qulonglong m_remaining;
|
||||
BitTorrent::FilePriority m_priority;
|
||||
BitTorrent::DownloadPriority m_priority;
|
||||
qreal m_progress;
|
||||
qreal m_availability;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user