mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-15 01:33:07 -07:00
- Fixed an exception with latest libtorrent/asio on startup (filepath check)
- Added an option to toggle the Peer eXchange (PeX) state
This commit is contained in:
parent
7d06099e80
commit
f017d29359
5 changed files with 30 additions and 20 deletions
|
@ -123,6 +123,7 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){
|
|||
connect(enableScan_checkBox, SIGNAL(stateChanged(int)), this, SLOT(enableApplyButton()));
|
||||
connect(disableMaxConnec, SIGNAL(stateChanged(int)), this, SLOT(enableApplyButton()));
|
||||
connect(disableDHT, SIGNAL(stateChanged(int)), this, SLOT(enableApplyButton()));
|
||||
connect(disablePeX, SIGNAL(stateChanged(int)), this, SLOT(enableApplyButton()));
|
||||
connect(spin_dht_port, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton()));
|
||||
// Language
|
||||
connect(combo_i18n, SIGNAL(currentIndexChanged(int)), this, SLOT(enableApplyButton()));
|
||||
|
@ -169,6 +170,7 @@ void options_imp::saveOptions(){
|
|||
settings.setValue("PortRangeMax", getPorts().second);
|
||||
settings.setValue("ShareRatio", getRatio());
|
||||
settings.setValue("DHTPort", getDHTPort());
|
||||
settings.setValue("PeXState", isPeXDisabled());
|
||||
settings.setValue("ScanDir", getScanDir());
|
||||
// End Main options
|
||||
settings.endGroup();
|
||||
|
@ -244,6 +246,7 @@ bool options_imp::isFilteringEnabled() const{
|
|||
void options_imp::loadOptions(){
|
||||
int value;
|
||||
float floatValue;
|
||||
bool boolValue;
|
||||
QString strValue;
|
||||
QSettings settings("qBittorrent", "qBittorrent");
|
||||
// Check if min port < max port
|
||||
|
@ -301,6 +304,14 @@ void options_imp::loadOptions(){
|
|||
}
|
||||
spin_dht_port->setValue(value);
|
||||
}
|
||||
boolValue = settings.value("PeXState", 0).toBool();
|
||||
if(value){
|
||||
// Pex disabled
|
||||
disablePeX->setChecked(true);
|
||||
}else{
|
||||
// PeX enabled
|
||||
disablePeX->setChecked(false);
|
||||
}
|
||||
strValue = settings.value("ScanDir", QString()).toString();
|
||||
if(!strValue.isEmpty()){
|
||||
enableScan_checkBox->setChecked(true);
|
||||
|
@ -434,6 +445,9 @@ bool options_imp::isDHTEnabled() const{
|
|||
return !disableDHT->isChecked();
|
||||
}
|
||||
|
||||
bool options_imp::isPeXDisabled() const{
|
||||
return disablePeX->isChecked();
|
||||
}
|
||||
// Return Download & Upload limits
|
||||
// [download,upload]
|
||||
QPair<int,int> options_imp::getLimits() const{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue