From 8a5d2208a5436e82d1a1d63a59429d9533119a3b Mon Sep 17 00:00:00 2001 From: sledgehammer999 Date: Sun, 10 May 2015 02:31:35 +0300 Subject: [PATCH] Fix UI freeze when right clicking on a torrent with libtorrent 1.0.x. Thanks to pmzqla for finding the root issue. Closes #2365 #2388. --- src/core/qtlibtorrent/qbtsession.cpp | 15 --------------- src/core/qtlibtorrent/qbtsession.h | 1 - src/gui/transferlistwidget.cpp | 2 +- 3 files changed, 1 insertion(+), 17 deletions(-) diff --git a/src/core/qtlibtorrent/qbtsession.cpp b/src/core/qtlibtorrent/qbtsession.cpp index aaa8f8c18..fc42aa6da 100644 --- a/src/core/qtlibtorrent/qbtsession.cpp +++ b/src/core/qtlibtorrent/qbtsession.cpp @@ -1694,21 +1694,6 @@ void QBtSession::saveFastResumeData() { } } -bool QBtSession::isFilePreviewPossible(const QString &hash) const { - // See if there are supported files in the torrent - const QTorrentHandle h = getTorrentHandle(hash); - if (!h.is_valid() || !h.has_metadata()) { - return false; - } - const unsigned int nbFiles = h.num_files(); - for (unsigned int i=0; i getTorrents() const; - bool isFilePreviewPossible(const QString& hash) const; qreal getPayloadDownloadRate() const; qreal getPayloadUploadRate() const; libtorrent::session_status getSessionStatus() const; diff --git a/src/gui/transferlistwidget.cpp b/src/gui/transferlistwidget.cpp index 9909e127a..db5fbc65f 100644 --- a/src/gui/transferlistwidget.cpp +++ b/src/gui/transferlistwidget.cpp @@ -852,7 +852,7 @@ void TransferListWidget::displayListMenu(const QPoint&) has_pause = true; } } - if (h.has_metadata() && BTSession->isFilePreviewPossible(hash) && !has_preview) + if (h.has_metadata() && !has_preview) has_preview = true; first = false; if (has_pause && has_start && has_force && has_preview && one_not_seed) break;