diff --git a/src/bittorrent.cpp b/src/bittorrent.cpp index 4f12fae61..1b9cffe95 100644 --- a/src/bittorrent.cpp +++ b/src/bittorrent.cpp @@ -254,15 +254,10 @@ void Bittorrent::configureSession() { // Connection // * Ports binding unsigned short old_listenPort = getListenPort(); - unsigned short new_listenPort; - if(old_listenPort != Preferences::getSessionPort()) { - setListeningPort(Preferences::getSessionPort()); - new_listenPort = getListenPort(); - if(new_listenPort != old_listenPort) { - addConsoleMessage(tr("qBittorrent is bound to port: TCP/%1", "e.g: qBittorrent is bound to port: 6881").arg( misc::toQString(new_listenPort))); - } - } else { - new_listenPort = old_listenPort; + unsigned short new_listenPort = Preferences::getSessionPort(); + if(old_listenPort != new_listenPort) { + setListeningPort(new_listenPort); + addConsoleMessage(tr("qBittorrent is bound to port: TCP/%1", "e.g: qBittorrent is bound to port: 6881").arg( misc::toQString(new_listenPort))); } // * Global download limit int down_limit = Preferences::getGlobalDownloadLimit(); @@ -366,8 +361,10 @@ void Bittorrent::configureSession() { if(Preferences::isDHTEnabled()) { // Set DHT Port if(enableDHT(true)) { - int dht_port = new_listenPort; - if(!Preferences::isDHTPortSameAsBT()) + int dht_port; + if(Preferences::isDHTPortSameAsBT()) + dht_port = new_listenPort; + else dht_port = Preferences::getDHTPort(); setDHTPort(dht_port); addConsoleMessage(tr("DHT support [ON], port: UDP/%1").arg(dht_port), QString::fromUtf8("blue")); @@ -1349,7 +1346,7 @@ void Bittorrent::changeLabelInTorrentSavePath(QTorrentHandle h, QString old_labe TorrentPersistentData::saveSavePath(h.hash(), new_save_path); if(move_storage) { // Move storage - h.move_storage(new_save_path); + h.move_storage(new_save_path); } emit savePathChanged(h); } diff --git a/src/ui/options.ui b/src/ui/options.ui index 8e8a8dcb7..099c7d0d5 100644 --- a/src/ui/options.ui +++ b/src/ui/options.ui @@ -1113,7 +1113,7 @@ QGroupBox { 0 0 - 451 + 602 505 @@ -1534,8 +1534,8 @@ QGroupBox { 0 0 - 466 - 368 + 620 + 495 @@ -1599,7 +1599,7 @@ QGroupBox { false - 1000 + 1024 65525 @@ -2345,8 +2345,8 @@ QGroupBox { 0 0 - 620 - 495 + 290 + 124 @@ -2442,8 +2442,8 @@ QGroupBox { 0 0 - 620 - 495 + 219 + 221 @@ -2606,8 +2606,8 @@ QGroupBox { 0 0 - 620 - 495 + 452 + 192