From c8753c96db095ee294a08a140cde10ce892b68da Mon Sep 17 00:00:00 2001 From: sledgehammer999 Date: Wed, 26 Dec 2012 19:31:02 +0200 Subject: [PATCH 1/2] Optimize the addittion of huge torrents. Fixes issue #288. --- src/qtlibtorrent/qbtsession.cpp | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/qtlibtorrent/qbtsession.cpp b/src/qtlibtorrent/qbtsession.cpp index da8334287..788759a0a 100755 --- a/src/qtlibtorrent/qbtsession.cpp +++ b/src/qtlibtorrent/qbtsession.cpp @@ -1270,20 +1270,11 @@ void QBtSession::loadTorrentTempData(QTorrentHandle &h, QString savePath, bool m // Update file names const QStringList files_path = TorrentTempData::getFilesPath(hash); bool force_recheck = false; + QDir base_dir(h.save_path()); if (files_path.size() == h.num_files()) { for (int i=0; i Date: Wed, 26 Dec 2012 20:00:31 +0200 Subject: [PATCH 2/2] Optimize the preview of huge torrents. Fixes issue #288. --- src/previewselect.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/previewselect.cpp b/src/previewselect.cpp index 1867430dc..5ba887298 100644 --- a/src/previewselect.cpp +++ b/src/previewselect.cpp @@ -99,9 +99,10 @@ void PreviewSelect::on_previewButton_clicked() { // Flush data h.flush_cache(); + QStringList absolute_paths(h.absolute_files_path()); QString path; foreach (index, selectedIndexes) { - path = h.absolute_files_path().at(indexes.at(index.row())); + path = absolute_paths.at(indexes.at(index.row())); // File if (QFile::exists(path)) { emit readyToPreviewFile(path);