Browse Source

- Fix "Append .!qB extension to incomplete files" feature

adaptive-webui-19844
Christophe Dumez 15 years ago
parent
commit
c1bc9886b7
  1. 6
      src/bittorrent.cpp

6
src/bittorrent.cpp

@ -1301,15 +1301,17 @@ void Bittorrent::appendqBextensionToTorrent(QTorrentHandle h, bool append) {
for(int i=0; i<h.num_files(); ++i) { for(int i=0; i<h.num_files(); ++i) {
if(append) { if(append) {
if(fp[i] < 1.) { 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")) { if(!name.endsWith(".!qB")) {
qDebug("Renaming %s to %s", name.toLocal8Bit().data(), (name+".!qB").toLocal8Bit().data());
h.rename_file(i, name + ".!qB"); h.rename_file(i, name + ".!qB");
} }
} }
} else { } else {
QString name = h.file_at(i); QString name = misc::toQString(h.get_torrent_info().file_at(i).path.string());
if(name.endsWith(".!qB")) { if(name.endsWith(".!qB")) {
name.chop(4); name.chop(4);
qDebug("Renaming %s to %s", (name+".!qB").toLocal8Bit().data(), name.toLocal8Bit().data());
h.rename_file(i, name); h.rename_file(i, name);
} }
} }

Loading…
Cancel
Save