forked from qt-creator/qt-creator
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:
@@ -393,20 +393,8 @@ 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)
|
|
||||||
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);
|
QNetworkProxyFactory::setUseSystemConfiguration(true);
|
||||||
#endif
|
|
||||||
// Load
|
// Load
|
||||||
const QStringList pluginPaths = getPluginPaths() + customPluginPaths;
|
const QStringList pluginPaths = getPluginPaths() + customPluginPaths;
|
||||||
PluginManager::setPluginPaths(pluginPaths);
|
PluginManager::setPluginPaths(pluginPaths);
|
||||||
|
|||||||
Reference in New Issue
Block a user