Browse Source

Fix the adding of .torrent files via http links which was broken by 30bc5a1da6.

adaptive-webui-19844
sledgehammer999 10 years ago
parent
commit
efb3936ef1
  1. 11
      src/qtlibtorrent/qbtsession.cpp

11
src/qtlibtorrent/qbtsession.cpp

@ -1016,7 +1016,12 @@ QTorrentHandle QBtSession::addTorrent(QString path, bool fromScanDir, QString fr
// Check if BT_backup directory exists // Check if BT_backup directory exists
const QDir torrentBackup(fsutils::BTBackupLocation()); const QDir torrentBackup(fsutils::BTBackupLocation());
if (!torrentBackup.exists()) return h; if (!torrentBackup.exists()) {
// If temporary file, remove it
if (!from_url.isNull() || fromScanDir)
fsutils::forceRemove(path);
return h;
}
// Fix the input path if necessary // Fix the input path if necessary
path = fsutils::fromNativePath(path); path = fsutils::fromNativePath(path);
@ -1148,7 +1153,8 @@ QTorrentHandle QBtSession::addTorrent(QString path, bool fromScanDir, QString fr
// Check if it worked // Check if it worked
if (!h.is_valid()) { if (!h.is_valid()) {
qDebug("/!\\ Error: Invalid handle"); qDebug("/!\\ Error: Invalid handle");
if (!from_url.isNull()) // If temporary file, remove it
if (!from_url.isNull() || fromScanDir)
fsutils::forceRemove(path); fsutils::forceRemove(path);
return h; return h;
} }
@ -2871,7 +2877,6 @@ void QBtSession::processDownloadedFile(QString url, QString file_path) {
h.pause(); h.pause();
emit newDownloadedTorrentFromRss(url); emit newDownloadedTorrentFromRss(url);
} }
fsutils::forceRemove(file_path);
} }
// Return current download rate for the BT // Return current download rate for the BT

Loading…
Cancel
Save