mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-17 22:18:05 -06:00
Add option to automatically remove .torrent files upon adding
Some browsers do not download files, intended for immediate opening, into a temporary directory, and thus a regular download directories accumulate those unneeded files. The option allows qBittorrent to clean after itself and delete those files whether they were succesfully added or not (user-selectable policy).
This commit is contained in:
@@ -70,6 +70,7 @@
|
||||
#include "base/net/portforwarder.h"
|
||||
#include "base/preferences.h"
|
||||
#include "base/settingsstorage.h"
|
||||
#include "base/torrentfileguard.h"
|
||||
#include "base/torrentfilter.h"
|
||||
#include "base/unicodestrings.h"
|
||||
#include "base/utils/misc.h"
|
||||
@@ -1229,6 +1230,8 @@ bool Session::addTorrent(QString source, const AddTorrentParams ¶ms)
|
||||
m_downloadedTorrents[handler->url()] = params;
|
||||
}
|
||||
else {
|
||||
TorrentFileGuard guard(source);
|
||||
guard.markAsAddedToSession();
|
||||
return addTorrent_impl(params, MagnetUri(), TorrentInfo::loadFromFile(source));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user