Browse Source

- Made sure that old fastresume is overwritten when saving new one

adaptive-webui-19844
Christophe Dumez 16 years ago
parent
commit
1efaea46e3
  1. 8
      src/bittorrent.cpp

8
src/bittorrent.cpp

@ -1077,20 +1077,23 @@ void bittorrent::setProxySettings(proxy_settings proxySettings, bool trackers, b
qDebug("Set Proxy settings"); qDebug("Set Proxy settings");
proxy_settings ps_null; proxy_settings ps_null;
ps_null.type = proxy_settings::none; ps_null.type = proxy_settings::none;
qDebug("Setting trackers proxy");
if(trackers) if(trackers)
s->set_tracker_proxy(proxySettings); s->set_tracker_proxy(proxySettings);
else else
s->set_tracker_proxy(ps_null); s->set_tracker_proxy(ps_null);
qDebug("Setting peers proxy");
if(peers) if(peers)
s->set_peer_proxy(proxySettings); s->set_peer_proxy(proxySettings);
else else
s->set_peer_proxy(ps_null); s->set_peer_proxy(ps_null);
qDebug("Setting web seeds proxy");
if(web_seeds) if(web_seeds)
s->set_web_seed_proxy(proxySettings); s->set_web_seed_proxy(proxySettings);
else else
s->set_web_seed_proxy(ps_null); s->set_web_seed_proxy(ps_null);
if(DHTEnabled) { if(DHTEnabled) {
qDebug("Setting DHT proxy");
if(dht) if(dht)
s->set_dht_proxy(proxySettings); s->set_dht_proxy(proxySettings);
else else
@ -1127,6 +1130,9 @@ void bittorrent::readAlerts() {
QDir torrentBackup(misc::qBittorrentPath() + "BT_backup"); QDir torrentBackup(misc::qBittorrentPath() + "BT_backup");
QTorrentHandle h(p->handle); QTorrentHandle h(p->handle);
QString file = h.hash()+".fastresume"; QString file = h.hash()+".fastresume";
// Delete old fastresume file if necessary
if(QFile::exists(file))
QFile::remove(file);
qDebug("Saving fastresume data in %s", file.toUtf8().data()); qDebug("Saving fastresume data in %s", file.toUtf8().data());
if (p->resume_data) if (p->resume_data)
{ {

Loading…
Cancel
Save