mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-09 14:27:56 +00: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
1
TODO
1
TODO
@ -36,7 +36,6 @@
|
|||||||
|
|
||||||
// In v0.9.0
|
// In v0.9.0
|
||||||
- Wait for libtorrent v0.12 official release
|
- Wait for libtorrent v0.12 official release
|
||||||
- Add an option to disable Peer Exchange (PeX)
|
|
||||||
- Move deletion from hard drive to a thread to avoid GUI freezing
|
- Move deletion from hard drive to a thread to avoid GUI freezing
|
||||||
- Should create options dialog only when needed to save up some memory
|
- Should create options dialog only when needed to save up some memory
|
||||||
- Download from RSS feeds
|
- Download from RSS feeds
|
12
src/GUI.cpp
12
src/GUI.cpp
@ -66,7 +66,7 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent){
|
|||||||
QCoreApplication::setApplicationName("qBittorrent");
|
QCoreApplication::setApplicationName("qBittorrent");
|
||||||
readSettings();
|
readSettings();
|
||||||
s = new session(fingerprint("qB", VERSION_MAJOR, VERSION_MINOR, VERSION_BUGFIX, 0));
|
s = new session(fingerprint("qB", VERSION_MAJOR, VERSION_MINOR, VERSION_BUGFIX, 0));
|
||||||
//s = new session(fingerprint("AZ", 2, 5, 0, 0)); //Azureus fingerprint
|
|
||||||
// Setting icons
|
// Setting icons
|
||||||
this->setWindowIcon(QIcon(QString::fromUtf8(":/Icons/qbittorrent32.png")));
|
this->setWindowIcon(QIcon(QString::fromUtf8(":/Icons/qbittorrent32.png")));
|
||||||
actionOpen->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/open.png")));
|
actionOpen->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/open.png")));
|
||||||
@ -124,14 +124,11 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent){
|
|||||||
connect(timerScan, SIGNAL(timeout()), this, SLOT(scanDirectory()));
|
connect(timerScan, SIGNAL(timeout()), this, SLOT(scanDirectory()));
|
||||||
// Set severity level of libtorrent session
|
// Set severity level of libtorrent session
|
||||||
s->set_severity_level(alert::info);
|
s->set_severity_level(alert::info);
|
||||||
// To avoid some exceptions
|
|
||||||
fs::path::default_name_check(fs::no_check);
|
|
||||||
// DHT (Trackerless)
|
// DHT (Trackerless)
|
||||||
DHTEnabled = false;
|
DHTEnabled = false;
|
||||||
// Configure BT session according to options
|
// Configure BT session according to options
|
||||||
configureSession();
|
configureSession();
|
||||||
s->add_extension(&create_metadata_plugin);
|
s->add_extension(&create_metadata_plugin);
|
||||||
s->add_extension(&create_ut_pex_plugin);
|
|
||||||
// download thread
|
// download thread
|
||||||
downloader = new downloadThread(this);
|
downloader = new downloadThread(this);
|
||||||
connect(downloader, SIGNAL(downloadFinished(QString, QString, int, QString)), this, SLOT(processDownloadedFile(QString, QString, int, QString)));
|
connect(downloader, SIGNAL(downloadFinished(QString, QString, int, QString)), this, SLOT(processDownloadedFile(QString, QString, int, QString)));
|
||||||
@ -1585,6 +1582,12 @@ void GUI::configureSession(){
|
|||||||
qDebug("Disabling DHT Support");
|
qDebug("Disabling DHT Support");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(!options->isPeXDisabled()){
|
||||||
|
qDebug("Enabling Peer eXchange (PeX)");
|
||||||
|
s->add_extension(&create_ut_pex_plugin);
|
||||||
|
}else{
|
||||||
|
qDebug("Peer eXchange (PeX) disabled");
|
||||||
|
}
|
||||||
int dht_port = options->getDHTPort();
|
int dht_port = options->getDHTPort();
|
||||||
if(dht_port >= 1000){
|
if(dht_port >= 1000){
|
||||||
struct dht_settings DHTSettings;
|
struct dht_settings DHTSettings;
|
||||||
@ -1610,7 +1613,6 @@ void GUI::configureSession(){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
proxySettings.user_agent = "qBittorrent "VERSION;
|
proxySettings.user_agent = "qBittorrent "VERSION;
|
||||||
//proxySettings.user_agent = "Azureus";
|
|
||||||
s->set_settings(proxySettings);
|
s->set_settings(proxySettings);
|
||||||
// Scan dir stuff
|
// Scan dir stuff
|
||||||
if(options->getScanDir().isNull()){
|
if(options->getScanDir().isNull()){
|
||||||
|
@ -505,7 +505,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="disableDHT" >
|
<widget class="QCheckBox" name="disableDHT" >
|
||||||
<property name="text" >
|
<property name="text" >
|
||||||
<string>Disable DHT (Trackerless) support</string>
|
<string>Disable DHT (Trackerless)</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -573,6 +573,13 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="disablePeX" >
|
||||||
|
<property name="text" >
|
||||||
|
<string>Disable Peer eXchange (PeX)</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -633,19 +640,6 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<spacer>
|
|
||||||
<property name="orientation" >
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" >
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>40</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="tab_3" >
|
<widget class="QWidget" name="tab_3" >
|
||||||
|
@ -123,6 +123,7 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){
|
|||||||
connect(enableScan_checkBox, SIGNAL(stateChanged(int)), this, SLOT(enableApplyButton()));
|
connect(enableScan_checkBox, SIGNAL(stateChanged(int)), this, SLOT(enableApplyButton()));
|
||||||
connect(disableMaxConnec, SIGNAL(stateChanged(int)), this, SLOT(enableApplyButton()));
|
connect(disableMaxConnec, SIGNAL(stateChanged(int)), this, SLOT(enableApplyButton()));
|
||||||
connect(disableDHT, 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()));
|
connect(spin_dht_port, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton()));
|
||||||
// Language
|
// Language
|
||||||
connect(combo_i18n, SIGNAL(currentIndexChanged(int)), this, SLOT(enableApplyButton()));
|
connect(combo_i18n, SIGNAL(currentIndexChanged(int)), this, SLOT(enableApplyButton()));
|
||||||
@ -169,6 +170,7 @@ void options_imp::saveOptions(){
|
|||||||
settings.setValue("PortRangeMax", getPorts().second);
|
settings.setValue("PortRangeMax", getPorts().second);
|
||||||
settings.setValue("ShareRatio", getRatio());
|
settings.setValue("ShareRatio", getRatio());
|
||||||
settings.setValue("DHTPort", getDHTPort());
|
settings.setValue("DHTPort", getDHTPort());
|
||||||
|
settings.setValue("PeXState", isPeXDisabled());
|
||||||
settings.setValue("ScanDir", getScanDir());
|
settings.setValue("ScanDir", getScanDir());
|
||||||
// End Main options
|
// End Main options
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
@ -244,6 +246,7 @@ bool options_imp::isFilteringEnabled() const{
|
|||||||
void options_imp::loadOptions(){
|
void options_imp::loadOptions(){
|
||||||
int value;
|
int value;
|
||||||
float floatValue;
|
float floatValue;
|
||||||
|
bool boolValue;
|
||||||
QString strValue;
|
QString strValue;
|
||||||
QSettings settings("qBittorrent", "qBittorrent");
|
QSettings settings("qBittorrent", "qBittorrent");
|
||||||
// Check if min port < max port
|
// Check if min port < max port
|
||||||
@ -301,6 +304,14 @@ void options_imp::loadOptions(){
|
|||||||
}
|
}
|
||||||
spin_dht_port->setValue(value);
|
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();
|
strValue = settings.value("ScanDir", QString()).toString();
|
||||||
if(!strValue.isEmpty()){
|
if(!strValue.isEmpty()){
|
||||||
enableScan_checkBox->setChecked(true);
|
enableScan_checkBox->setChecked(true);
|
||||||
@ -434,6 +445,9 @@ bool options_imp::isDHTEnabled() const{
|
|||||||
return !disableDHT->isChecked();
|
return !disableDHT->isChecked();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool options_imp::isPeXDisabled() const{
|
||||||
|
return disablePeX->isChecked();
|
||||||
|
}
|
||||||
// Return Download & Upload limits
|
// Return Download & Upload limits
|
||||||
// [download,upload]
|
// [download,upload]
|
||||||
QPair<int,int> options_imp::getLimits() const{
|
QPair<int,int> options_imp::getLimits() const{
|
||||||
|
@ -52,6 +52,7 @@ class options_imp : public QDialog, private Ui::Dialog{
|
|||||||
QString getScanDir() const;
|
QString getScanDir() const;
|
||||||
bool isDHTEnabled() const;
|
bool isDHTEnabled() const;
|
||||||
int getDHTPort() const;
|
int getDHTPort() const;
|
||||||
|
bool isPeXDisabled() const;
|
||||||
// Filter Settings
|
// Filter Settings
|
||||||
bool isFilteringEnabled() const;
|
bool isFilteringEnabled() const;
|
||||||
ip_filter getFilter() const;
|
ip_filter getFilter() const;
|
||||||
|
Loading…
Reference in New Issue
Block a user