Do not crash on some system when no proxy is set

This commit is contained in:
Daniel Molkentin
2009-08-10 11:41:28 +02:00
parent 0ab8f1ed46
commit 452a565ea2

View File

@@ -120,7 +120,9 @@ RSSFetcher::RSSFetcher(int maxItems, QObject *parent)
void RSSFetcher::fetch(const QUrl &url) void RSSFetcher::fetch(const QUrl &url)
{ {
m_http.setProxy(QNetworkProxyFactory::systemProxyForQuery(QNetworkProxyQuery(url)).first()); QList<QNetworkProxy> proxies = QNetworkProxyFactory::systemProxyForQuery(QNetworkProxyQuery(url));
if (proxies.count() > 0)
m_http.setProxy(proxies.first());
m_http.setHost(url.host()); m_http.setHost(url.host());
QString agentStr = QString("Qt-Creator/%1 (QHttp %2; %3; %4; %5 bit)") QString agentStr = QString("Qt-Creator/%1 (QHttp %2; %3; %4; %5 bit)")
.arg(Core::Constants::IDE_VERSION_LONG).arg(qVersion()) .arg(Core::Constants::IDE_VERSION_LONG).arg(qVersion())