mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-19 15:07:22 -06:00
- BUGFIX: Fixed everlasting libtorrent session destruction on exit
This commit is contained in:
1
TODO
1
TODO
@@ -67,3 +67,4 @@ rc8->rc9 changelog:
|
|||||||
- BUGFIX: Fixed HTTP_PW and SOCKS5_PW in proxy combobox
|
- BUGFIX: Fixed HTTP_PW and SOCKS5_PW in proxy combobox
|
||||||
- BUGFIX: Fixed proxy auth disable problem when disabling proxy
|
- BUGFIX: Fixed proxy auth disable problem when disabling proxy
|
||||||
- BUGFIX: Fixed proxy layout in program preferences
|
- BUGFIX: Fixed proxy layout in program preferences
|
||||||
|
- BUGFIX: Fixed everlasting libtorrent session destruction on exit
|
||||||
|
|||||||
@@ -43,7 +43,7 @@
|
|||||||
#define MAX_TRACKER_ERRORS 2
|
#define MAX_TRACKER_ERRORS 2
|
||||||
|
|
||||||
// Main constructor
|
// Main constructor
|
||||||
bittorrent::bittorrent() : timerScan(0), DHTEnabled(false), preAllocateAll(false), addInPause(false), maxConnecsPerTorrent(500), maxUploadsPerTorrent(4), max_ratio(-1) {
|
bittorrent::bittorrent() : timerScan(0), DHTEnabled(false), preAllocateAll(false), addInPause(false), maxConnecsPerTorrent(500), maxUploadsPerTorrent(4), max_ratio(-1), UPnPEnabled(false), NATPMPEnabled(false), LSDEnabled(false) {
|
||||||
// To avoid some exceptions
|
// To avoid some exceptions
|
||||||
fs::path::default_name_check(fs::no_check);
|
fs::path::default_name_check(fs::no_check);
|
||||||
// Creating bittorrent session
|
// Creating bittorrent session
|
||||||
@@ -631,25 +631,49 @@ bool bittorrent::isDHTEnabled() const{
|
|||||||
|
|
||||||
void bittorrent::enableUPnP(bool b) {
|
void bittorrent::enableUPnP(bool b) {
|
||||||
if(b) {
|
if(b) {
|
||||||
s->start_upnp();
|
if(!UPnPEnabled) {
|
||||||
|
qDebug("Enabling UPnP");
|
||||||
|
s->start_upnp();
|
||||||
|
UPnPEnabled = true;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
s->stop_upnp();
|
if(UPnPEnabled) {
|
||||||
|
qDebug("Disabling UPnP");
|
||||||
|
s->stop_upnp();
|
||||||
|
UPnPEnabled = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void bittorrent::enableNATPMP(bool b) {
|
void bittorrent::enableNATPMP(bool b) {
|
||||||
if(b) {
|
if(b) {
|
||||||
s->start_natpmp();
|
if(!NATPMPEnabled) {
|
||||||
|
qDebug("Enabling NAT-PMP");
|
||||||
|
s->start_natpmp();
|
||||||
|
NATPMPEnabled = true;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
s->stop_natpmp();
|
if(NATPMPEnabled) {
|
||||||
|
qDebug("Disabling NAT-PMP");
|
||||||
|
s->stop_natpmp();
|
||||||
|
NATPMPEnabled = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void bittorrent::enableLSD(bool b) {
|
void bittorrent::enableLSD(bool b) {
|
||||||
if(b) {
|
if(b) {
|
||||||
s->start_lsd();
|
if(!LSDEnabled) {
|
||||||
|
qDebug("Enabling LSD");
|
||||||
|
s->start_lsd();
|
||||||
|
LSDEnabled = true;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
s->stop_lsd();
|
if(LSDEnabled) {
|
||||||
|
qDebug("Disabling LSD");
|
||||||
|
s->stop_lsd();
|
||||||
|
LSDEnabled = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -62,6 +62,9 @@ class bittorrent : public QObject{
|
|||||||
int maxConnecsPerTorrent;
|
int maxConnecsPerTorrent;
|
||||||
int maxUploadsPerTorrent;
|
int maxUploadsPerTorrent;
|
||||||
float max_ratio;
|
float max_ratio;
|
||||||
|
bool UPnPEnabled;
|
||||||
|
bool NATPMPEnabled;
|
||||||
|
bool LSDEnabled;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QString getSavePath(QString hash);
|
QString getSavePath(QString hash);
|
||||||
|
|||||||
@@ -190,7 +190,6 @@ void DownloadingTorrents::setInfoBar(QString info, QColor color) {
|
|||||||
infoBar->clear();
|
infoBar->clear();
|
||||||
nbLines = 1;
|
nbLines = 1;
|
||||||
}
|
}
|
||||||
qDebug("Color is %s", color.name().toUtf8().data());
|
|
||||||
infoBar->append(QString::fromUtf8("<font color='grey'>")+ QTime::currentTime().toString(QString::fromUtf8("hh:mm:ss")) + QString::fromUtf8("</font> - <font color='") + color.name() +QString::fromUtf8("'><i>") + info + QString::fromUtf8("</i></font>"));
|
infoBar->append(QString::fromUtf8("<font color='grey'>")+ QTime::currentTime().toString(QString::fromUtf8("hh:mm:ss")) + QString::fromUtf8("</font> - <font color='") + color.name() +QString::fromUtf8("'><i>") + info + QString::fromUtf8("</i></font>"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user