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:
con
2011-03-30 14:58:05 +02:00
parent dbe32f8944
commit 4edec9f92a

View File

@@ -251,15 +251,18 @@ int main(int argc, char **argv)
}
// 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")));
if (proxyUrl.isValid()) {
QNetworkProxy proxy(QNetworkProxy::HttpProxy, proxyUrl.host(),
proxyUrl.port(), proxyUrl.userName(), proxyUrl.password());
QNetworkProxy::setApplicationProxy(proxy);
}
#else
QNetworkProxyFactory::setUseSystemConfiguration(true);
#if defined(Q_OS_MAC)
else {
QNetworkProxyFactory::setUseSystemConfiguration(true);
}
#endif
#endif
// Load
const QStringList pluginPaths = getPluginPaths();