mirror of
https://github.com/transmission/transmission.git
synced 2025-12-20 10:28:32 +00:00
Fix torrent file trashing upon addition (Qt client)
This commit is contained in:
@@ -995,7 +995,7 @@ void Session::addTorrent(AddData const& addMe, tr_variant* args, bool trashOrigi
|
|||||||
d->show();
|
d->show();
|
||||||
});
|
});
|
||||||
|
|
||||||
q->add([this, addMe](RpcResponse const& r)
|
q->add([this, addMe, trashOriginal](RpcResponse const& r)
|
||||||
{
|
{
|
||||||
tr_variant* dup;
|
tr_variant* dup;
|
||||||
char const* str;
|
char const* str;
|
||||||
@@ -1010,17 +1010,13 @@ void Session::addTorrent(AddData const& addMe, tr_variant* args, bool trashOrigi
|
|||||||
connect(d, SIGNAL(rejected()), d, SLOT(deleteLater()));
|
connect(d, SIGNAL(rejected()), d, SLOT(deleteLater()));
|
||||||
d->show();
|
d->show();
|
||||||
}
|
}
|
||||||
});
|
else if (trashOriginal && addMe.type == AddData::FILENAME)
|
||||||
|
|
||||||
if (trashOriginal && addMe.type == AddData::FILENAME)
|
|
||||||
{
|
|
||||||
q->add([this, addMe]()
|
|
||||||
{
|
{
|
||||||
QFile original(addMe.filename);
|
QFile original(addMe.filename);
|
||||||
original.setPermissions(QFile::ReadOwner | QFile::WriteOwner);
|
original.setPermissions(QFile::ReadOwner | QFile::WriteOwner);
|
||||||
original.remove();
|
original.remove();
|
||||||
});
|
}
|
||||||
}
|
});
|
||||||
|
|
||||||
q->run();
|
q->run();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user