mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-16 02:03:07 -07:00
- Forgot to remove temporary download file when addition failed
This commit is contained in:
parent
9540d45c1d
commit
aada4f3c03
2 changed files with 6 additions and 0 deletions
|
@ -530,6 +530,7 @@ void bittorrent::addTorrent(QString path, bool fromScanDir, QString from_url, bo
|
||||||
// Display warning to tell user we can't decode the torrent file
|
// Display warning to tell user we can't decode the torrent file
|
||||||
if(!from_url.isNull()) {
|
if(!from_url.isNull()) {
|
||||||
emit invalidTorrent(from_url);
|
emit invalidTorrent(from_url);
|
||||||
|
QFile::remove(file);
|
||||||
}else{
|
}else{
|
||||||
emit invalidTorrent(file);
|
emit invalidTorrent(file);
|
||||||
}
|
}
|
||||||
|
@ -544,6 +545,8 @@ void bittorrent::addTorrent(QString path, bool fromScanDir, QString from_url, bo
|
||||||
// Display warning to tell user we can't decode the torrent file
|
// Display warning to tell user we can't decode the torrent file
|
||||||
if(!from_url.isNull()) {
|
if(!from_url.isNull()) {
|
||||||
emit invalidTorrent(from_url);
|
emit invalidTorrent(from_url);
|
||||||
|
qDebug("File path is: %s", file.toUtf8().data());
|
||||||
|
QFile::remove(file);
|
||||||
}else{
|
}else{
|
||||||
emit invalidTorrent(file);
|
emit invalidTorrent(file);
|
||||||
}
|
}
|
||||||
|
|
|
@ -125,6 +125,7 @@ class torrentAdditionDialog : public QDialog, private Ui_addTorrentDialog{
|
||||||
// Display warning to tell user we can't decode the torrent file
|
// Display warning to tell user we can't decode the torrent file
|
||||||
if(!from_url.isNull()){
|
if(!from_url.isNull()){
|
||||||
emit setInfoBarGUI(tr("Unable to decode torrent file:")+QString::fromUtf8(" '")+from_url+QString::fromUtf8("'"), QString::fromUtf8("red"));
|
emit setInfoBarGUI(tr("Unable to decode torrent file:")+QString::fromUtf8(" '")+from_url+QString::fromUtf8("'"), QString::fromUtf8("red"));
|
||||||
|
QFile::remove(filePath);
|
||||||
}else{
|
}else{
|
||||||
emit setInfoBarGUI(tr("Unable to decode torrent file:")+QString::fromUtf8(" '")+filePath+QString::fromUtf8("'"), QString::fromUtf8("red"));
|
emit setInfoBarGUI(tr("Unable to decode torrent file:")+QString::fromUtf8(" '")+filePath+QString::fromUtf8("'"), QString::fromUtf8("red"));
|
||||||
}
|
}
|
||||||
|
@ -142,9 +143,11 @@ class torrentAdditionDialog : public QDialog, private Ui_addTorrentDialog{
|
||||||
// Display warning to tell user we can't decode the torrent file
|
// Display warning to tell user we can't decode the torrent file
|
||||||
if(!from_url.isNull()){
|
if(!from_url.isNull()){
|
||||||
emit setInfoBarGUI(tr("Unable to decode torrent file:")+QString::fromUtf8(" '")+from_url+QString::fromUtf8("'"), QString::fromUtf8("red"));
|
emit setInfoBarGUI(tr("Unable to decode torrent file:")+QString::fromUtf8(" '")+from_url+QString::fromUtf8("'"), QString::fromUtf8("red"));
|
||||||
|
QFile::remove(filePath);
|
||||||
}else{
|
}else{
|
||||||
emit setInfoBarGUI(tr("Unable to decode torrent file:")+QString::fromUtf8(" '")+filePath+QString::fromUtf8("'"), QString::fromUtf8("red"));
|
emit setInfoBarGUI(tr("Unable to decode torrent file:")+QString::fromUtf8(" '")+filePath+QString::fromUtf8("'"), QString::fromUtf8("red"));
|
||||||
}
|
}
|
||||||
|
qDebug("path is %s", filePath.toUtf8().data());
|
||||||
emit setInfoBarGUI(tr("This file is either corrupted or this isn't a torrent."), QString::fromUtf8("red"));
|
emit setInfoBarGUI(tr("This file is either corrupted or this isn't a torrent."), QString::fromUtf8("red"));
|
||||||
if(fromScanDir){
|
if(fromScanDir){
|
||||||
// Remove .corrupt file in case it already exists
|
// Remove .corrupt file in case it already exists
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue