Skip to content
Permalink
Browse files

back to wms only

  • Loading branch information
Stefan Ziegler
Stefan Ziegler committed Mar 29, 2013
1 parent ade381f commit 1b7d94b96b8db6068c8a0091718ee40bf5f15701
@@ -93,12 +93,6 @@ QgsOWSConnection::QgsOWSConnection( const QString & theService, const QString &
mUri.setParam( "password", password );
}

QString referer = settings.value( key + "/referer" ).toString();
if ( !referer.isEmpty() )
{
mUri.setParam( "referer", referer );
}

bool ignoreGetMap = settings.value( key + "/ignoreGetMapURI", false ).toBool();
bool ignoreGetFeatureInfo = settings.value( key + "/ignoreGetFeatureInfoURI", false ).toBool();
bool ignoreAxisOrientation = settings.value( key + "/ignoreAxisOrientation", false ).toBool();
@@ -345,10 +345,9 @@ QDomDocument QgsManageConnectionsDialog::saveOWSConnections( const QStringList &
el.setAttribute( "ignoreGetFeatureInfoURI", settings.value( path + connections[i] + "/ignoreGetFeatureInfoURI", false ).toBool() ? "true" : "false" );
el.setAttribute( "ignoreAxisOrientation", settings.value( path + connections[i] + "/ignoreAxisOrientation", false ).toBool() ? "true" : "false" );
el.setAttribute( "invertAxisOrientation", settings.value( path + connections[i] + "/invertAxisOrientation", false ).toBool() ? "true" : "false" );
el.setAttribute( "referer", settings.value( path + connections[ i ] + "/referer", "" ).toString() );
}

el.setAttribute( "referer", settings.value( path + connections[ i ] + "/referer", "" ).toString() );

path = "/Qgis/" + service.toUpper() + "/";
el.setAttribute( "username", settings.value( path + connections[ i ] + "/username", "" ).toString() );
el.setAttribute( "password", settings.value( path + connections[ i ] + "/password", "" ).toString() );
@@ -661,7 +660,6 @@ void QgsManageConnectionsDialog::loadWFSConnections( const QDomDocument &doc, co
// no dups detected or overwrite is allowed
settings.beginGroup( "/Qgis/connections-wfs" );
settings.setValue( QString( "/" + connectionName + "/url" ) , child.attribute( "url" ) );
settings.setValue( QString( "/" + connectionName + "/referer" ), child.attribute( "referer" ) );
settings.endGroup();

if ( !child.attribute( "username" ).isEmpty() )
@@ -81,6 +81,11 @@ QgsNewHttpConnection::QgsNewHttpConnection(

cbxIgnoreGetFeatureInfoURI->setVisible( false );
mGroupBox->layout()->removeWidget( cbxIgnoreGetFeatureInfoURI );

txtReferer->setVisible( false );
mGroupBox->layout()->removeWidget( txtReferer );
lblReferer->setVisible( false );
mGroupBox->layout()->removeWidget( lblReferer );

// Adjust height
int w = width();
@@ -36,7 +36,7 @@ QgsWFSCapabilities::QgsWFSCapabilities( QString theUri ) :
mBaseUrl = prepareUri( mUri.param( "url" ) );

QgsDebugMsg( "mBaseUrl = " + mBaseUrl );

//find out the server URL
/*
QSettings settings;
@@ -142,20 +142,10 @@ void QgsWFSCapabilities::requestCapabilities()

QNetworkRequest request( uriGetCapabilities() );
request.setAttribute( QNetworkRequest::CacheSaveControlAttribute, true );
setReferer( request );
mCapabilitiesReply = QgsNetworkAccessManager::instance()->get( request );
connect( mCapabilitiesReply, SIGNAL( finished() ), this, SLOT( capabilitiesReplyFinished() ) );
}

void QgsWFSCapabilities::setReferer( QNetworkRequest &request ) const
{
QString referer = mUri.param( "referer" );
if ( !referer.isNull() )
{
request.setRawHeader( "Referer", QString( "%1" ).arg( referer ).toAscii() );
}
}

void QgsWFSCapabilities::capabilitiesReplyFinished()
{
// handle network errors
@@ -21,7 +21,6 @@
#include "qgsdatasourceuri.h"

class QNetworkReply;
class QNetworkRequest;

class QgsWFSCapabilities : public QObject
{
@@ -48,10 +47,7 @@ class QgsWFSCapabilities : public QObject

//! start network connection to get capabilities
void requestCapabilities();

//! set referer header
void setReferer( QNetworkRequest &request ) const;


//! description of a vector layer
struct FeatureType
{
@@ -1522,7 +1522,7 @@ int QgsWmsProvider::bandCount() const
void QgsWmsProvider::capabilitiesReplyProgress( qint64 bytesReceived, qint64 bytesTotal )
{
QString msg = tr( "%1 of %2 bytes of capabilities downloaded." ).arg( bytesReceived ).arg( bytesTotal < 0 ? QString( "unknown number of" ) : QString::number( bytesTotal ) );
//QgsDebugMsg( msg );
QgsDebugMsg( msg );
emit statusChanged( msg );
}

@@ -1601,7 +1601,7 @@ bool QgsWmsProvider::parseCapabilitiesDom( QByteArray const &xml, QgsWmsCapabili
QDomElement e = n.toElement(); // try to convert the node to an element.
if ( !e.isNull() )
{
//QgsDebugMsg(e.tagName() ); // the node really is an element.
QgsDebugMsg(e.tagName() ); // the node really is an element.

if ( e.tagName() == "Service" || e.tagName() == "ows:ServiceProvider" || e.tagName() == "ows:ServiceIdentification" )
{
@@ -2236,7 +2236,7 @@ void QgsWmsProvider::parseLayer( QDomElement const & e, QgsWmsLayerProperty& lay
QDomElement e1 = n1.toElement(); // try to convert the node to an element.
if ( !e1.isNull() )
{
//QgsDebugMsg( " " + e1.tagName() ); // the node really is an element.
QgsDebugMsg( " " + e1.tagName() ); // the node really is an element.

QString tagName = e1.tagName();
if ( tagName.startsWith( "wms:" ) )
@@ -2718,13 +2718,13 @@ void QgsWmsProvider::parseWMTSContents( QDomElement const &e )

double res = m.scaleDenom * 0.00028 / metersPerUnit;

/*QgsDebugMsg( QString( " %1: scale=%2 res=%3 tile=%4x%5 matrix=%6x%7 topLeft=%8" )
QgsDebugMsg( QString( " %1: scale=%2 res=%3 tile=%4x%5 matrix=%6x%7 topLeft=%8" )
.arg( m.identifier )
.arg( m.scaleDenom ).arg( res )
.arg( m.tileWidth ).arg( m.tileHeight )
.arg( m.matrixWidth ).arg( m.matrixHeight )
.arg( m.topLeft.toString() )
);*/
);

s.tileMatrices.insert( res, m );
}
@@ -2742,7 +2742,7 @@ void QgsWmsProvider::parseWMTSContents( QDomElement const &e )
e0 = e0.nextSiblingElement( "Layer" ) )
{
QString id = e0.firstChildElement( "ows:Identifier" ).text();
//QgsDebugMsg( QString( "Layer %1" ).arg( id ) );
QgsDebugMsg( QString( "Layer %1" ).arg( id ) );

QgsWmtsTileLayer l;
l.tileMode = WMTS;
@@ -2940,7 +2940,7 @@ void QgsWmsProvider::parseWMTSContents( QDomElement const &e )
}
}

//QgsDebugMsg( QString( "add layer %1" ).arg( id ) );
QgsDebugMsg( QString( "add layer %1" ).arg( id ) );
mTileLayersSupported << l;
}

@@ -3010,7 +3010,7 @@ bool QgsWmsProvider::parseServiceExceptionReportDom( QByteArray const & xml )
QDomElement e = n.toElement(); // try to convert the node to an element.
if ( !e.isNull() )
{
//QgsDebugMsg(e.tagName() ); // the node really is an element.
QgsDebugMsg(e.tagName() ); // the node really is an element.

QString tagName = e.tagName();
if ( tagName.startsWith( "wms:" ) )
@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>475</width>
<height>400</height>
<height>415</height>
</rect>
</property>
<property name="windowTitle">
@@ -55,7 +55,7 @@
</sizepolicy>
</property>
<property name="text">
<string>If the service requires basic authentication, enter a user name, an optional password and an optional referer</string>
<string>If the service requires basic authentication, enter a user name and optional password</string>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
@@ -166,7 +166,7 @@
<widget class="QLineEdit" name="txtReferer"/>
</item>
<item row="7" column="0">
<widget class="QLabel" name="label_4">
<widget class="QLabel" name="lblReferer">
<property name="text">
<string>Referer</string>
</property>

0 comments on commit 1b7d94b

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