mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-19 12:59:56 -07:00
TorrentContentModel code clean up
This commit is contained in:
parent
12a83e1aec
commit
edcfa4df12
3 changed files with 6 additions and 8 deletions
|
@ -297,7 +297,7 @@ void TorrentContentModel::setupModelData(const libtorrent::torrent_info& t)
|
||||||
current_parent = new_parent;
|
current_parent = new_parent;
|
||||||
}
|
}
|
||||||
// Actually create the file
|
// Actually create the file
|
||||||
m_filesIndex.push_back(new TorrentContentModelItem(t, fentry, current_parent, i));
|
m_filesIndex.push_back(new TorrentContentModelItem(fentry, current_parent, i));
|
||||||
}
|
}
|
||||||
emit layoutChanged();
|
emit layoutChanged();
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,8 +33,7 @@
|
||||||
#include "torrentcontentmodelitem.h"
|
#include "torrentcontentmodelitem.h"
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
TorrentContentModelItem::TorrentContentModelItem(const libtorrent::torrent_info &t,
|
TorrentContentModelItem::TorrentContentModelItem(const libtorrent::file_entry &f,
|
||||||
const libtorrent::file_entry &f,
|
|
||||||
TorrentContentModelItem *parent,
|
TorrentContentModelItem *parent,
|
||||||
int file_index):
|
int file_index):
|
||||||
m_parentItem(parent), m_type(TFILE), m_fileIndex(file_index), m_totalDone(0)
|
m_parentItem(parent), m_type(TFILE), m_fileIndex(file_index), m_totalDone(0)
|
||||||
|
@ -42,7 +41,7 @@ TorrentContentModelItem::TorrentContentModelItem(const libtorrent::torrent_info
|
||||||
Q_ASSERT(parent);
|
Q_ASSERT(parent);
|
||||||
|
|
||||||
#if LIBTORRENT_VERSION_MINOR >= 16
|
#if LIBTORRENT_VERSION_MINOR >= 16
|
||||||
QString name = fsutils::fileName(misc::toQStringU(t.files().file_path(f)));
|
QString name = fsutils::fileName(misc::toQStringU(f.path.c_str()));
|
||||||
#else
|
#else
|
||||||
Q_UNUSED(t);
|
Q_UNUSED(t);
|
||||||
QString name = misc::toQStringU(f.path.filename());
|
QString name = misc::toQStringU(f.path.filename());
|
||||||
|
|
|
@ -45,8 +45,7 @@ public:
|
||||||
enum FileType {TFILE, FOLDER, ROOT};
|
enum FileType {TFILE, FOLDER, ROOT};
|
||||||
|
|
||||||
// File Construction
|
// File Construction
|
||||||
TorrentContentModelItem(const libtorrent::torrent_info &t,
|
TorrentContentModelItem(const libtorrent::file_entry &f,
|
||||||
const libtorrent::file_entry &f,
|
|
||||||
TorrentContentModelItem *parent,
|
TorrentContentModelItem *parent,
|
||||||
int file_index);
|
int file_index);
|
||||||
// Folder constructor
|
// Folder constructor
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue