Skip to content
Permalink
Browse files

Apply proxy settings also for WFS

git-svn-id: http://svn.osgeo.org/qgis/trunk@10031 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent
mhugent committed Jan 27, 2009
1 parent abb9f95 commit 730eb13a3e415ec73288f9f793704ab9c962392a
Showing with 3 additions and 99 deletions.
  1. +3 −0 src/providers/wfs/qgswfsdata.cpp
  2. +0 −99 src/providers/wms/qgswmsprovider.cpp
@@ -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 @@ int QgsWFSData::getWFSData()
mHttp.setHost( requestUrl.host() );
}

QgsHttpTransaction::applyProxySettings( mHttp, mUri );

//mHttp.get( mUri );
mHttp.get( requestUrl.path() + "?" + QString( requestUrl.encodedQuery() ) );

@@ -637,49 +637,6 @@ bool QgsWmsProvider::retrieveServerCapabilities( bool forceRefresh )
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 @@ QByteArray QgsWmsProvider::retrieveUrl( QString url )
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." );

0 comments on commit 730eb13

Please sign in to comment.
You can’t perform that action at this time.