mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-15 09:43:07 -07:00
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.
This commit is contained in:
parent
18e2bb6f60
commit
8a5d2208a5
3 changed files with 1 additions and 17 deletions
|
@ -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<nbFiles; ++i) {
|
|
||||||
const QString extension = fsutils::fileExtension(h.filename_at(i));
|
|
||||||
if (misc::isPreviewable(extension))
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void QBtSession::addTorrentsFromScanFolder(QStringList &pathList)
|
void QBtSession::addTorrentsFromScanFolder(QStringList &pathList)
|
||||||
{
|
{
|
||||||
foreach (const QString &file, pathList) {
|
foreach (const QString &file, pathList) {
|
||||||
|
|
|
@ -120,7 +120,6 @@ public:
|
||||||
~QBtSession();
|
~QBtSession();
|
||||||
QTorrentHandle getTorrentHandle(const QString &hash) const;
|
QTorrentHandle getTorrentHandle(const QString &hash) const;
|
||||||
std::vector<libtorrent::torrent_handle> getTorrents() const;
|
std::vector<libtorrent::torrent_handle> getTorrents() const;
|
||||||
bool isFilePreviewPossible(const QString& hash) const;
|
|
||||||
qreal getPayloadDownloadRate() const;
|
qreal getPayloadDownloadRate() const;
|
||||||
qreal getPayloadUploadRate() const;
|
qreal getPayloadUploadRate() const;
|
||||||
libtorrent::session_status getSessionStatus() const;
|
libtorrent::session_status getSessionStatus() const;
|
||||||
|
|
|
@ -852,7 +852,7 @@ void TransferListWidget::displayListMenu(const QPoint&)
|
||||||
has_pause = true;
|
has_pause = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (h.has_metadata() && BTSession->isFilePreviewPossible(hash) && !has_preview)
|
if (h.has_metadata() && !has_preview)
|
||||||
has_preview = true;
|
has_preview = true;
|
||||||
first = false;
|
first = false;
|
||||||
if (has_pause && has_start && has_force && has_preview && one_not_seed) break;
|
if (has_pause && has_start && has_force && has_preview && one_not_seed) break;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue