Skip to content

Commit

Permalink
Apply proxy settings also for WFS
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@10031 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Jan 27, 2009
1 parent abb9f95 commit 730eb13
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 99 deletions.
3 changes: 3 additions & 0 deletions src/providers/wfs/qgswfsdata.cpp
Expand Up @@ -15,6 +15,7 @@
#include "qgswfsdata.h"
#include "qgsrectangle.h"
#include "qgscoordinatereferencesystem.h"
#include "qgshttptransaction.h"
#include <QBuffer>
#include <QUrl>
#include <QList>
Expand Down Expand Up @@ -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() ) );

Expand Down
99 changes: 0 additions & 99 deletions src/providers/wms/qgswmsprovider.cpp
Expand Up @@ -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
Expand Down Expand Up @@ -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." );
Expand Down

0 comments on commit 730eb13

Please sign in to comment.