mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-12 16:23:07 -07: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:
parent
35c51ad3b1
commit
6e73fa80b8
10 changed files with 391 additions and 49 deletions
|
@ -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));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue