From a55a27508a65f798eeee9e2d2272d07c39f870dc Mon Sep 17 00:00:00 2001 From: "Vladimir Golovnev (Glassez)" Date: Fri, 12 Jun 2015 15:35:20 +0300 Subject: [PATCH 1/2] Fix append .!qB extension when it disabled. --- src/core/bittorrent/torrenthandle.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/bittorrent/torrenthandle.cpp b/src/core/bittorrent/torrenthandle.cpp index f2ef6a45d..651859aeb 100644 --- a/src/core/bittorrent/torrenthandle.cpp +++ b/src/core/bittorrent/torrenthandle.cpp @@ -206,7 +206,8 @@ TorrentHandle::TorrentHandle(Session *session, const libtorrent::torrent_handle if (!data.resumed) { if (hasMetadata()) { setFirstLastPiecePriority(data.sequential); - appendExtensionsToIncompleteFiles(); + if (m_session->isAppendExtensionEnabled()) + appendExtensionsToIncompleteFiles(); } } } @@ -1550,7 +1551,8 @@ void TorrentHandle::handleMetadataReceivedAlert(libt::metadata_received_alert *p Q_UNUSED(p); qDebug("Metadata received for torrent %s.", qPrintable(name())); updateStatus(); - appendExtensionsToIncompleteFiles(); + if (m_session->isAppendExtensionEnabled()) + appendExtensionsToIncompleteFiles(); m_session->handleTorrentMetadataReceived(this); if (isPaused()) { From 9c28977001fe436ea958dc28f1e3a89eab80459e Mon Sep 17 00:00:00 2001 From: "Vladimir Golovnev (Glassez)" Date: Fri, 12 Jun 2015 15:37:52 +0300 Subject: [PATCH 2/2] Fix adjustActualSavePath() when torrent is moving. --- src/core/bittorrent/torrenthandle.cpp | 8 ++++++++ src/core/bittorrent/torrenthandle.h | 1 + 2 files changed, 9 insertions(+) diff --git a/src/core/bittorrent/torrenthandle.cpp b/src/core/bittorrent/torrenthandle.cpp index 651859aeb..5d4e1f867 100644 --- a/src/core/bittorrent/torrenthandle.cpp +++ b/src/core/bittorrent/torrenthandle.cpp @@ -1691,6 +1691,14 @@ void TorrentHandle::removeExtensionsFromIncompleteFiles() } void TorrentHandle::adjustActualSavePath() +{ + if (!isMoveInProgress()) + adjustActualSavePath_impl(); + else + m_moveStorageTriggers.append(boost::bind(&TorrentHandle::adjustActualSavePath_impl, this)); +} + +void TorrentHandle::adjustActualSavePath_impl() { QString path; if (!useTempPath()) { diff --git a/src/core/bittorrent/torrenthandle.h b/src/core/bittorrent/torrenthandle.h index 541ce96c4..bbab9a73f 100644 --- a/src/core/bittorrent/torrenthandle.h +++ b/src/core/bittorrent/torrenthandle.h @@ -333,6 +333,7 @@ namespace BitTorrent void resolveCountries(bool b); void adjustSavePath(); void adjustActualSavePath(); + void adjustActualSavePath_impl(); void moveStorage(const QString &newPath); void appendExtensionsToIncompleteFiles(); void removeExtensionsFromIncompleteFiles();