- Fix some other listen port issues

This commit is contained in:
Christophe Dumez 2009-12-29 09:59:32 +00:00
parent 1bfadf5219
commit ff5e5d1062
2 changed files with 19 additions and 22 deletions

View file

@ -254,16 +254,11 @@ 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) {
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)));
}
} else {
new_listenPort = old_listenPort;
}
// * Global download limit
int down_limit = Preferences::getGlobalDownloadLimit();
if(down_limit <= 0) {
@ -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"));

View file

@ -1113,7 +1113,7 @@ QGroupBox {
<rect>
<x>0</x>
<y>0</y>
<width>451</width>
<width>602</width>
<height>505</height>
</rect>
</property>
@ -1534,8 +1534,8 @@ QGroupBox {
<rect>
<x>0</x>
<y>0</y>
<width>466</width>
<height>368</height>
<width>620</width>
<height>495</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_19">
@ -1599,7 +1599,7 @@ QGroupBox {
<bool>false</bool>
</property>
<property name="minimum">
<number>1000</number>
<number>1024</number>
</property>
<property name="maximum">
<number>65525</number>
@ -2345,8 +2345,8 @@ QGroupBox {
<rect>
<x>0</x>
<y>0</y>
<width>620</width>
<height>495</height>
<width>290</width>
<height>124</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_21">
@ -2442,8 +2442,8 @@ QGroupBox {
<rect>
<x>0</x>
<y>0</y>
<width>620</width>
<height>495</height>
<width>219</width>
<height>221</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_23">
@ -2606,8 +2606,8 @@ QGroupBox {
<rect>
<x>0</x>
<y>0</y>
<width>620</width>
<height>495</height>
<width>452</width>
<height>192</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_24">