forked from qt-creator/qt-creator
Workaround for Mac users with automatic proxy configuration
Qt's implementation for the Mac system configuration doesn't handle automatic proxy configurations. Qt Creator now also looks at the http_proxy environment variable on Mac as a workaround. Task-number: QTCREATORBUG-4190 Reviewed-by: Daniel Molkentin
This commit is contained in:
@@ -251,15 +251,18 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Make sure we honor the system's proxy settings
|
// Make sure we honor the system's proxy settings
|
||||||
#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
|
#if defined(Q_OS_UNIX)
|
||||||
QUrl proxyUrl(QString::fromLatin1(qgetenv("http_proxy")));
|
QUrl proxyUrl(QString::fromLatin1(qgetenv("http_proxy")));
|
||||||
if (proxyUrl.isValid()) {
|
if (proxyUrl.isValid()) {
|
||||||
QNetworkProxy proxy(QNetworkProxy::HttpProxy, proxyUrl.host(),
|
QNetworkProxy proxy(QNetworkProxy::HttpProxy, proxyUrl.host(),
|
||||||
proxyUrl.port(), proxyUrl.userName(), proxyUrl.password());
|
proxyUrl.port(), proxyUrl.userName(), proxyUrl.password());
|
||||||
QNetworkProxy::setApplicationProxy(proxy);
|
QNetworkProxy::setApplicationProxy(proxy);
|
||||||
}
|
}
|
||||||
#else
|
#if defined(Q_OS_MAC)
|
||||||
|
else {
|
||||||
QNetworkProxyFactory::setUseSystemConfiguration(true);
|
QNetworkProxyFactory::setUseSystemConfiguration(true);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
// Load
|
// Load
|
||||||
const QStringList pluginPaths = getPluginPaths();
|
const QStringList pluginPaths = getPluginPaths();
|
||||||
|
|||||||
Reference in New Issue
Block a user