mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-23 04:54:18 +00:00
Simplify TorrentContentModel code
This commit is contained in:
parent
5fe5c4d147
commit
8ad821c468
@ -268,14 +268,11 @@ void TorrentContentModel::setupModelData(const libtorrent::torrent_info& t)
|
|||||||
qDebug("Torrent contains %d files", t.num_files());
|
qDebug("Torrent contains %d files", t.num_files());
|
||||||
m_filesIndex.reserve(t.num_files());
|
m_filesIndex.reserve(t.num_files());
|
||||||
|
|
||||||
TorrentContentModelFolder* parent = m_rootItem;
|
|
||||||
TorrentContentModelFolder* root_folder = parent;
|
|
||||||
TorrentContentModelFolder* current_parent;
|
TorrentContentModelFolder* current_parent;
|
||||||
|
|
||||||
// Iterate over files
|
// Iterate over files
|
||||||
for (int i=0; i<t.num_files(); ++i) {
|
for (int i = 0; i < t.num_files(); ++i) {
|
||||||
const libtorrent::file_entry& fentry = t.file_at(i);
|
const libtorrent::file_entry& fentry = t.file_at(i);
|
||||||
current_parent = root_folder;
|
current_parent = m_rootItem;
|
||||||
#if LIBTORRENT_VERSION_MINOR >= 16
|
#if LIBTORRENT_VERSION_MINOR >= 16
|
||||||
QString path = misc::toQStringU(fentry.path);
|
QString path = misc::toQStringU(fentry.path);
|
||||||
#else
|
#else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user