[QGIS Commit] r10031 - in trunk/qgis/src/providers: wfs wms
svn_qgis at osgeo.org
svn_qgis at osgeo.org
Tue Jan 27 05:45:41 EST 2009
Author: mhugent
Date: 2009-01-27 05:45:41 -0500 (Tue, 27 Jan 2009)
New Revision: 10031
Modified:
trunk/qgis/src/providers/wfs/qgswfsdata.cpp
trunk/qgis/src/providers/wms/qgswmsprovider.cpp
Log:
Apply proxy settings also for WFS
Modified: trunk/qgis/src/providers/wfs/qgswfsdata.cpp
===================================================================
--- trunk/qgis/src/providers/wfs/qgswfsdata.cpp 2009-01-27 08:33:58 UTC (rev 10030)
+++ trunk/qgis/src/providers/wfs/qgswfsdata.cpp 2009-01-27 10:45:41 UTC (rev 10031)
@@ -15,6 +15,7 @@
#include "qgswfsdata.h"
#include "qgsrectangle.h"
#include "qgscoordinatereferencesystem.h"
+#include "qgshttptransaction.h"
#include <QBuffer>
#include <QUrl>
#include <QList>
@@ -90,6 +91,8 @@
mHttp.setHost( requestUrl.host() );
}
+ QgsHttpTransaction::applyProxySettings( mHttp, mUri );
+
//mHttp.get( mUri );
mHttp.get( requestUrl.path() + "?" + QString( requestUrl.encodedQuery() ) );
Modified: trunk/qgis/src/providers/wms/qgswmsprovider.cpp
===================================================================
--- trunk/qgis/src/providers/wms/qgswmsprovider.cpp 2009-01-27 08:33:58 UTC (rev 10030)
+++ trunk/qgis/src/providers/wms/qgswmsprovider.cpp 2009-01-27 10:45:41 UTC (rev 10031)
@@ -637,49 +637,6 @@
QByteArray QgsWmsProvider::retrieveUrl( QString url )
{
QgsDebugMsg( "WMS request Url: " + url );
-
-#if 0 //MH: not necessary any more
- //read proxy settings
- QSettings settings;
- QString proxyHost, proxyUser, proxyPassword;
- int proxyPort;
- QNetworkProxy::ProxyType proxyType = QNetworkProxy::NoProxy;
-
- bool proxyEnabled = settings.value( "proxy/proxyEnabled", "0" ).toBool();
- if ( proxyEnabled )
- {
- proxyHost = settings.value( "proxy/proxyHost", "" ).toString();
- proxyPort = settings.value( "proxy/proxyPort", "" ).toString().toInt();
- proxyUser = settings.value( "proxy/proxyUser", "" ).toString();
- proxyPassword = settings.value( "proxy/proxyPassword", "" ).toString();
- QString proxyTypeString = settings.value( "proxy/proxyType", "" ).toString();
- if ( proxyTypeString == "DefaultProxy" )
- {
- proxyType = QNetworkProxy::DefaultProxy;
- }
- else if ( proxyTypeString == "Socks5Proxy" )
- {
- proxyType = QNetworkProxy::Socks5Proxy;
- }
- else if ( proxyTypeString == "HttpProxy" )
- {
- proxyType = QNetworkProxy::HttpProxy;
- }
- else if ( proxyTypeString == "HttpCachingProxy" )
- {
- proxyType = QNetworkProxy::HttpCachingProxy;
- }
- else if ( proxyTypeString == "FtpCachingProxy" )
- {
- proxyType = QNetworkProxy::FtpCachingProxy;
- }
- }
-
-
-
- QgsHttpTransaction http( url, proxyHost, proxyPort, proxyUser, proxyPassword, proxyType );
-#endif //0
-
QgsHttpTransaction http( url );
// Do a passthrough for the status bar text
@@ -726,62 +683,6 @@
return httpResponse;
}
-#if 0
-// deprecated
-bool QgsWmsProvider::downloadCapabilitiesURI( QString const & uri )
-{
-
- QgsDebugMsg( "Entered with '" + uri + "'" );
-
- QgsHttpTransaction http( uri, httpproxyhost, httpproxyport );
-
- // Do a passthrough for the status bar text
- connect(
- &http, SIGNAL( statusChanged( QString ) ),
- this, SLOT( showStatusMessage( QString ) )
- );
-
- bool httpOk;
- httpOk = http.getSynchronously( httpcapabilitiesresponse );
-
- if ( !httpOk )
- {
- // We had an HTTP exception
-
- mErrorCaption = tr( "HTTP Exception" );
- mError = http.errorString();
-
- mError += "\n" + tr( "Tried URL: " ) + uri;
-
- QgsDebugMsg( "!httpOK: " + mError );
-
- return FALSE;
- }
-
- QgsDebugMsg( "Converting to Dom." );
-
- bool domOK;
- domOK = parseCapabilitiesDom( httpcapabilitiesresponse, capabilities );
-
- if ( !domOK )
- {
- // We had an Dom exception -
- // mErrorCaption and mError are pre-filled by parseCapabilitiesDom
-
- mError += "\n" + tr( "Tried URL: " ) + uri;
-
- QgsDebugMsg( "!domOK: " + mError );
-
- return FALSE;
- }
-
- QgsDebugMsg( "exiting." );
-
- return TRUE;
-
-}
-#endif
-
bool QgsWmsProvider::parseCapabilitiesDom( QByteArray const & xml, QgsWmsCapabilitiesProperty& capabilitiesProperty )
{
QgsDebugMsg( "entering." );
More information about the QGIS-commit
mailing list