From 8589eb7c0fc6480fac95b4f0b787b2469d499f3c Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Thu, 21 Apr 2011 18:57:43 +0000 Subject: [PATCH] Code optimization --- src/qtlibtorrent/qtorrenthandle.cpp | 2 ++ src/torrentfilesmodel.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/qtlibtorrent/qtorrenthandle.cpp b/src/qtlibtorrent/qtorrenthandle.cpp index 6c192f860..c9c465ae7 100644 --- a/src/qtlibtorrent/qtorrenthandle.cpp +++ b/src/qtlibtorrent/qtorrenthandle.cpp @@ -420,6 +420,8 @@ QStringList QTorrentHandle::absolute_files_path_uneeded() const { QDir saveDir(save_path()); QStringList res; std::vector fp = torrent_handle::file_priorities(); + qDebug() << fp.size() << num_files(); + Q_ASSERT(fp.size() == num_files()); for(int i = 0; i < num_files(); ++i) { if(fp[i] == 0) { const QString file_path = QDir::cleanPath(saveDir.absoluteFilePath(filepath_at(i))); diff --git a/src/torrentfilesmodel.h b/src/torrentfilesmodel.h index 3318887cb..aac58060c 100644 --- a/src/torrentfilesmodel.h +++ b/src/torrentfilesmodel.h @@ -360,7 +360,7 @@ public: emit dataChanged(index(0,0), index(rowCount(), columnCount())); } - void updateFilesPriorities(std::vector fprio) { + void updateFilesPriorities(const std::vector &fprio) { emit layoutAboutToBeChanged(); for(unsigned int i=0; i