mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-23 04:54:18 +00:00
Don't remove shared temp folder
This commit is contained in:
parent
6043584305
commit
f067b8b37c
@ -1651,14 +1651,13 @@ bool Session::deleteTorrent(const QString &hash, bool deleteLocalFiles)
|
|||||||
|
|
||||||
// Remove it from session
|
// Remove it from session
|
||||||
if (deleteLocalFiles) {
|
if (deleteLocalFiles) {
|
||||||
if (torrent->savePath(true) == torrentTempPath(torrent->info())) {
|
QString rootPath = torrent->rootPath(true);
|
||||||
|
if (!rootPath.isEmpty())
|
||||||
|
// torrent with root folder
|
||||||
|
m_savePathsToRemove[torrent->hash()] = rootPath;
|
||||||
|
else if (torrent->useTempPath())
|
||||||
|
// torrent without root folder still has it in its temporary save path
|
||||||
m_savePathsToRemove[torrent->hash()] = torrent->savePath(true);
|
m_savePathsToRemove[torrent->hash()] = torrent->savePath(true);
|
||||||
}
|
|
||||||
else {
|
|
||||||
QString rootPath = torrent->rootPath(true);
|
|
||||||
if (!rootPath.isEmpty())
|
|
||||||
m_savePathsToRemove[torrent->hash()] = rootPath;
|
|
||||||
}
|
|
||||||
m_nativeSession->remove_torrent(torrent->nativeHandle(), libt::session::delete_files);
|
m_nativeSession->remove_torrent(torrent->nativeHandle(), libt::session::delete_files);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -244,6 +244,8 @@ namespace BitTorrent
|
|||||||
QString rootPath(bool actual = false) const;
|
QString rootPath(bool actual = false) const;
|
||||||
QString contentPath(bool actual = false) const;
|
QString contentPath(bool actual = false) const;
|
||||||
|
|
||||||
|
bool useTempPath() const;
|
||||||
|
|
||||||
bool isAutoTMMEnabled() const;
|
bool isAutoTMMEnabled() const;
|
||||||
void setAutoTMMEnabled(bool enabled);
|
void setAutoTMMEnabled(bool enabled);
|
||||||
QString category() const;
|
QString category() const;
|
||||||
@ -416,7 +418,6 @@ namespace BitTorrent
|
|||||||
void handleStatsAlert(libtorrent::stats_alert *p);
|
void handleStatsAlert(libtorrent::stats_alert *p);
|
||||||
|
|
||||||
bool isMoveInProgress() const;
|
bool isMoveInProgress() const;
|
||||||
bool useTempPath() const;
|
|
||||||
QString nativeActualSavePath() const;
|
QString nativeActualSavePath() const;
|
||||||
|
|
||||||
void adjustActualSavePath();
|
void adjustActualSavePath();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user