Browse Source

TorrentContentModel code cleanup

adaptive-webui-19844
Christophe Dumez 12 years ago
parent
commit
3f755de80b
  1. 2
      src/torrentcontentmodel.cpp
  2. 5
      src/torrentcontentmodelfile.cpp
  3. 3
      src/torrentcontentmodelfile.h

2
src/torrentcontentmodel.cpp

@ -296,7 +296,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 TorrentContentModelFile(t, fentry, current_parent, i)); m_filesIndex.push_back(new TorrentContentModelFile(fentry, current_parent, i));
} }
emit layoutChanged(); emit layoutChanged();
} }

5
src/torrentcontentmodelfile.cpp

@ -33,8 +33,7 @@
#include "fs_utils.h" #include "fs_utils.h"
#include "misc.h" #include "misc.h"
TorrentContentModelFile::TorrentContentModelFile(const libtorrent::torrent_info& t, TorrentContentModelFile::TorrentContentModelFile(const libtorrent::file_entry& f,
const libtorrent::file_entry& f,
TorrentContentModelFolder* parent, TorrentContentModelFolder* parent,
int file_index) int file_index)
: TorrentContentModelItem(parent) : TorrentContentModelItem(parent)
@ -43,7 +42,7 @@ TorrentContentModelFile::TorrentContentModelFile(const libtorrent::torrent_info&
Q_ASSERT(parent); Q_ASSERT(parent);
#if LIBTORRENT_VERSION_MINOR >= 16 #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 #else
m_name = misc::toQStringU(f.path.filename()); m_name = misc::toQStringU(f.path.filename());
#endif #endif

3
src/torrentcontentmodelfile.h

@ -36,8 +36,7 @@
class TorrentContentModelFile : public TorrentContentModelItem class TorrentContentModelFile : public TorrentContentModelItem
{ {
public: public:
TorrentContentModelFile(const libtorrent::torrent_info& t, TorrentContentModelFile(const libtorrent::file_entry& f,
const libtorrent::file_entry& f,
TorrentContentModelFolder* parent, TorrentContentModelFolder* parent,
int file_index); int file_index);

Loading…
Cancel
Save