mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-19 06:57:24 -06:00
Fix compilation and execution with msvc
This commit is contained in:
@@ -1851,8 +1851,13 @@ void Bittorrent::addConsoleMessage(QString msg, QString) {
|
||||
default:
|
||||
qDebug("Disabling HTTP communications proxy");
|
||||
#ifdef Q_WS_WIN
|
||||
#ifdef MINGW
|
||||
putenv("http_proxy=");
|
||||
putenv("sock_proxy=");
|
||||
#else
|
||||
SetEnvironmentVariableA("http_proxy", "");
|
||||
SetEnvironmentVariableA("sock_proxy", "");
|
||||
#endif
|
||||
#else
|
||||
unsetenv("http_proxy");
|
||||
unsetenv("sock_proxy");
|
||||
@@ -1861,12 +1866,17 @@ void Bittorrent::addConsoleMessage(QString msg, QString) {
|
||||
}
|
||||
// We need this for urllib in search engine plugins
|
||||
#ifdef Q_WS_WIN
|
||||
QString proxyStr;
|
||||
QString proxyType;
|
||||
if(proxySettings.type == proxy_settings::socks5 || proxySettings.type == proxy_settings::socks5_pw)
|
||||
proxyStr = "sock_proxy=" + proxy_str;
|
||||
proxyType = "sock_proxy";
|
||||
else
|
||||
proxyStr = "http_proxy=" + proxy_str;
|
||||
putenv(proxyStr.toLocal8Bit().constData());
|
||||
proxyType = "http_proxy";
|
||||
#ifdef MINGW
|
||||
QString tmp = proxyType+"="+proxy_str;
|
||||
putenv(tmp.toLocal8Bit().constData());
|
||||
#else
|
||||
SetEnvironmentVariableA(proxyType.toLocal8Bit().constData(), proxy_str.toLocal8Bit().constData());
|
||||
#endif
|
||||
#else
|
||||
qDebug("HTTP communications proxy string: %s", qPrintable(proxy_str));
|
||||
if(proxySettings.type == proxy_settings::socks5 || proxySettings.type == proxy_settings::socks5_pw)
|
||||
|
||||
Reference in New Issue
Block a user