From c56b4a25bcb793e16807a420ae6154e608d7b19b Mon Sep 17 00:00:00 2001 From: "Vladimir Golovnev (Glassez)" Date: Wed, 26 Apr 2017 11:38:50 +0300 Subject: [PATCH] Remove torrent temp folder if it becomes unneeded --- src/base/bittorrent/torrenthandle.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/base/bittorrent/torrenthandle.cpp b/src/base/bittorrent/torrenthandle.cpp index 5a2255bf0..976afd0a9 100644 --- a/src/base/bittorrent/torrenthandle.cpp +++ b/src/base/bittorrent/torrenthandle.cpp @@ -1358,6 +1358,10 @@ void TorrentHandle::handleStorageMovedAlert(libtorrent::storage_moved_alert *p) } qDebug("Torrent is successfully moved from %s to %s", qPrintable(m_oldPath), qPrintable(m_newPath)); + if (m_oldPath == m_session->torrentTempPath(hash())) { + qDebug() << "Removing torrent temp folder:" << m_oldPath; + Utils::Fs::smartRemoveEmptyFolderTree(m_oldPath); + } updateStatus(); m_newPath.clear();