Browse Source

- fix for UPnP option

adaptive-webui-19844
Christophe Dumez 18 years ago
parent
commit
e0a0a0beb1
  1. 1
      TODO
  2. 6
      src/GUI.cpp
  3. 4
      src/bittorrent.cpp
  4. 2
      src/bittorrent.h

1
TODO

@ -43,3 +43,4 @@
- Improve Ipfilter.dat parser (move to a thread ?) - Improve Ipfilter.dat parser (move to a thread ?)
- Use tooltips to explain options - Use tooltips to explain options
- Exit confirmation only if there are active downloads - Exit confirmation only if there are active downloads
- Support UPnP port edition

6
src/GUI.cpp

@ -986,7 +986,11 @@ void GUI::configureSession(bool deleteOptions){
} }
#ifndef NO_UPNP #ifndef NO_UPNP
// Upnp // Upnp
BTSession.enableUPnP(); if(options->isDHTEnabled()){
BTSession.enableUPnP(options->getUPnPPort());
}else{
BTSession.disableUPnP();
}
#endif #endif
// PeX // PeX
if(!options->isPeXDisabled()){ if(!options->isPeXDisabled()){

4
src/bittorrent.cpp

@ -75,7 +75,7 @@ torrent_handle bittorrent::getTorrentHandle(const QString& hash) const{
} }
#ifndef NO_UPNP #ifndef NO_UPNP
void bittorrent::enableUPnP(){ void bittorrent::enableUPnP(int port){
if(!UPnPEnabled){ if(!UPnPEnabled){
qDebug("Enabling UPnP"); qDebug("Enabling UPnP");
UPnPEnabled = true; UPnPEnabled = true;
@ -85,7 +85,7 @@ void bittorrent::enableUPnP(){
"TCP", "TCP",
true, true,
"qBittorrent"); "qBittorrent");
m_upnp = new CUPnPControlPoint(50000); m_upnp = new CUPnPControlPoint(port);
m_upnp->AddPortMappings(m_upnpMappings); m_upnp->AddPortMappings(m_upnpMappings);
} }
} }

2
src/bittorrent.h

@ -119,7 +119,7 @@ class bittorrent : public QObject{
void setSessionSettings(session_settings sessionSettings); void setSessionSettings(session_settings sessionSettings);
void setDefaultSavePath(const QString& savepath); void setDefaultSavePath(const QString& savepath);
#ifndef NO_UPNP #ifndef NO_UPNP
void enableUPnP(); void enableUPnP(int port=50000);
void disableUPnP(); void disableUPnP();
#endif #endif

Loading…
Cancel
Save