mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-13 16:28:06 +00:00
- Fix "Append .!qB extension to incomplete files" feature
This commit is contained in:
parent
88f8437c5a
commit
c1bc9886b7
@ -1301,15 +1301,17 @@ void Bittorrent::appendqBextensionToTorrent(QTorrentHandle h, bool append) {
|
||||
for(int i=0; i<h.num_files(); ++i) {
|
||||
if(append) {
|
||||
if(fp[i] < 1.) {
|
||||
QString name = h.file_at(i);
|
||||
QString name = misc::toQString(h.get_torrent_info().file_at(i).path.string());
|
||||
if(!name.endsWith(".!qB")) {
|
||||
qDebug("Renaming %s to %s", name.toLocal8Bit().data(), (name+".!qB").toLocal8Bit().data());
|
||||
h.rename_file(i, name + ".!qB");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
QString name = h.file_at(i);
|
||||
QString name = misc::toQString(h.get_torrent_info().file_at(i).path.string());
|
||||
if(name.endsWith(".!qB")) {
|
||||
name.chop(4);
|
||||
qDebug("Renaming %s to %s", (name+".!qB").toLocal8Bit().data(), name.toLocal8Bit().data());
|
||||
h.rename_file(i, name);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user