OSDN Git Service

Workaround for Mac users with automatic proxy configuration
authorcon <qtc-committer@nokia.com>
Wed, 30 Mar 2011 12:58:05 +0000 (14:58 +0200)
committercon <qtc-committer@nokia.com>
Wed, 30 Mar 2011 12:58:28 +0000 (14:58 +0200)
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
src/app/main.cpp

index 471dd7b..52a769c 100644 (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();