From 3f755de80b29a2709a1e5bfc933d0f573e9509de Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Sun, 26 Aug 2012 21:33:52 +0300 Subject: [PATCH] TorrentContentModel code cleanup --- src/torrentcontentmodel.cpp | 2 +- src/torrentcontentmodelfile.cpp | 5 ++--- src/torrentcontentmodelfile.h | 3 +-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/torrentcontentmodel.cpp b/src/torrentcontentmodel.cpp index a5992d77b..0cba82c9b 100644 --- a/src/torrentcontentmodel.cpp +++ b/src/torrentcontentmodel.cpp @@ -296,7 +296,7 @@ void TorrentContentModel::setupModelData(const libtorrent::torrent_info& t) current_parent = new_parent; } // Actually create the file - m_filesIndex.push_back(new TorrentContentModelFile(t, fentry, current_parent, i)); + m_filesIndex.push_back(new TorrentContentModelFile(fentry, current_parent, i)); } emit layoutChanged(); } diff --git a/src/torrentcontentmodelfile.cpp b/src/torrentcontentmodelfile.cpp index a55a7be53..a8d640f0d 100644 --- a/src/torrentcontentmodelfile.cpp +++ b/src/torrentcontentmodelfile.cpp @@ -33,8 +33,7 @@ #include "fs_utils.h" #include "misc.h" -TorrentContentModelFile::TorrentContentModelFile(const libtorrent::torrent_info& t, - const libtorrent::file_entry& f, +TorrentContentModelFile::TorrentContentModelFile(const libtorrent::file_entry& f, TorrentContentModelFolder* parent, int file_index) : TorrentContentModelItem(parent) @@ -43,7 +42,7 @@ TorrentContentModelFile::TorrentContentModelFile(const libtorrent::torrent_info& Q_ASSERT(parent); #if LIBTORRENT_VERSION_MINOR >= 16 - m_name = fsutils::fileName(misc::toQStringU(t.files().file_path(f))); + m_name = fsutils::fileName(misc::toQStringU(f.path.c_str())); #else m_name = misc::toQStringU(f.path.filename()); #endif diff --git a/src/torrentcontentmodelfile.h b/src/torrentcontentmodelfile.h index 95329a4b4..594333e7c 100644 --- a/src/torrentcontentmodelfile.h +++ b/src/torrentcontentmodelfile.h @@ -36,8 +36,7 @@ class TorrentContentModelFile : public TorrentContentModelItem { public: - TorrentContentModelFile(const libtorrent::torrent_info& t, - const libtorrent::file_entry& f, + TorrentContentModelFile(const libtorrent::file_entry& f, TorrentContentModelFolder* parent, int file_index);