mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-16 02:03:07 -07:00
Importance code refactoring related to the "preferences" code - Greatly improves performance
This commit is contained in:
parent
a640b08414
commit
e5032a52c4
26 changed files with 976 additions and 1142 deletions
|
@ -51,10 +51,11 @@ ProgramUpdater::ProgramUpdater(QObject *parent) :
|
|||
QObject(parent)
|
||||
{
|
||||
mp_manager = new QNetworkAccessManager(this);
|
||||
Preferences pref;
|
||||
// Proxy support
|
||||
if(Preferences::isHTTPProxyEnabled()) {
|
||||
if(pref.isHTTPProxyEnabled()) {
|
||||
QNetworkProxy proxy;
|
||||
switch(Preferences::getHTTPProxyType()) {
|
||||
switch(pref.getHTTPProxyType()) {
|
||||
case Proxy::SOCKS4:
|
||||
case Proxy::SOCKS5:
|
||||
case Proxy::SOCKS5_PW:
|
||||
|
@ -63,12 +64,12 @@ ProgramUpdater::ProgramUpdater(QObject *parent) :
|
|||
proxy.setType(QNetworkProxy::HttpProxy);
|
||||
break;
|
||||
}
|
||||
proxy.setHostName(Preferences::getHTTPProxyIp());
|
||||
proxy.setPort(Preferences::getHTTPProxyPort());
|
||||
proxy.setHostName(pref.getHTTPProxyIp());
|
||||
proxy.setPort(pref.getHTTPProxyPort());
|
||||
// Proxy authentication
|
||||
if(Preferences::isHTTPProxyAuthEnabled()) {
|
||||
proxy.setUser(Preferences::getHTTPProxyUsername());
|
||||
proxy.setPassword(Preferences::getHTTPProxyPassword());
|
||||
if(pref.isHTTPProxyAuthEnabled()) {
|
||||
proxy.setUser(pref.getHTTPProxyUsername());
|
||||
proxy.setPassword(pref.getHTTPProxyPassword());
|
||||
}
|
||||
mp_manager->setProxy(proxy);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue