Use systemProxyForQuery() everywhere

For generic Unix, Qt automatically picks up http_proxy since
Qt 4.8 (commit 2ec929a2b). It also picks up e.g. https_proxy etc,
so it's better to rely on it.

On OS X we want to use the system proxy settings, that allow
also more advanced configuration like different proxies for
different services, passwords ...

Change-Id: I72de5e576e4d34d87f4c787bb597db0ca59a70e1
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
Kai Koehne
2014-11-27 15:16:57 +01:00
parent cd76a574b1
commit aac92c84d4

View File

@@ -393,20 +393,8 @@ int main(int argc, char **argv)
}
// Make sure we honor the system's proxy settings
#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);
# if defined(Q_OS_MAC) // unix and mac
} else {
QNetworkProxyFactory::setUseSystemConfiguration(true);
# endif
}
#else // windows
QNetworkProxyFactory::setUseSystemConfiguration(true);
#endif
// Load
const QStringList pluginPaths = getPluginPaths() + customPluginPaths;
PluginManager::setPluginPaths(pluginPaths);