Skip to content

Commit

Permalink
Correct Socks5 proxy error.
Browse files Browse the repository at this point in the history
  • Loading branch information
baumgarr committed Mar 20, 2017
1 parent 6c73829 commit 029f7d8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions global.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1113,14 +1113,14 @@ bool Global::isProxyEnabled() {
// Set the Sock5 proxy
void Global::setSocks5Enabled(bool value) {
settings->beginGroup("Proxy");
settings->setValue("enabled", value);
settings->setValue("socks5", value);
settings->endGroup();
}

// Get the Socks5 proxy
bool Global::isSocks5Enabled() {
settings->beginGroup("Proxy");
bool value = settings->value("enabled", false).toBool();
bool value = settings->value("socks5", false).toBool();
settings->endGroup();
return value;
}
Expand Down
8 changes: 4 additions & 4 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,11 +265,9 @@ int main(int argc, char *argv[])

// Setup the proxy
QNetworkProxy proxy;
if (global.isSocks5Enabled())
proxy.setType(QNetworkProxy::Socks5Proxy);
else
proxy.setType(QNetworkProxy::HttpProxy);
if (global.isProxyEnabled()) {
if (global.isSocks5Enabled())
proxy.setType(QNetworkProxy::Socks5Proxy);
QString host = global.getProxyHost();
int port = global.getProxyPort();
QString user = global.getProxyUserid();
Expand All @@ -285,6 +283,8 @@ int main(int argc, char *argv[])
proxy.setPassword(password.trimmed());

QNetworkProxy::setApplicationProxy(proxy);
} else {
proxy.setType(QNetworkProxy::HttpProxy);
}

QLOG_DEBUG() << "Setting up exit signal";
Expand Down

0 comments on commit 029f7d8

Please sign in to comment.