Skip to content
Permalink
Browse files

Add Service element when taking contact information from the project …

…file
  • Loading branch information
mhugent committed Jul 12, 2011
1 parent e67648a commit 62e62f652d63d8cf2eaca13365d5022324ad5787
Showing with 8 additions and 5 deletions.
  1. +8 −5 src/mapserver/qgsprojectparser.cpp
@@ -363,7 +363,7 @@ QList<QgsMapLayer*> QgsProjectParser::mapLayerFromStyle( const QString& lName, c
{
QString project = convertToAbsolutePath( groupIt->attribute( "project" ) );
QgsDebugMsg( QString( "Project path: %1" ).arg( project ) );
QgsProjectParser* p = dynamic_cast<QgsProjectParser*>( QgsConfigCache::instance()->searchConfiguration( project ) );
QgsProjectParser* p = dynamic_cast<QgsProjectParser*>( QgsConfigCache::instance()->searchConfiguration( project ) );
if ( p )
{
QList<QDomElement> pGroupElems = p->legendGroupElements();
@@ -1252,6 +1252,8 @@ QDomElement QgsProjectParser::composerByName( const QString& composerName ) cons

void QgsProjectParser::serviceCapabilities( QDomElement& parentElement, QDomDocument& doc ) const
{
QDomElement serviceElem = doc.createElement( "Service" );

QDomElement propertiesElem = mXMLDoc->documentElement().firstChildElement( "properties" );
if ( propertiesElem.isNull() )
{
@@ -1270,7 +1272,7 @@ void QgsProjectParser::serviceCapabilities( QDomElement& parentElement, QDomDocu
QDomElement wmsNameElem = doc.createElement( "Name" );
QDomText wmsNameText = doc.createTextNode( "WMS" );
wmsNameElem.appendChild( wmsNameText );
parentElement.appendChild( wmsNameElem );
serviceElem.appendChild( wmsNameElem );

//WMS title
QDomElement titleElem = propertiesElem.firstChildElement( "WMSServiceTitle" );
@@ -1279,7 +1281,7 @@ void QgsProjectParser::serviceCapabilities( QDomElement& parentElement, QDomDocu
QDomElement wmsTitleElem = doc.createElement( "Title" );
QDomText wmsTitleText = doc.createTextNode( titleElem.text() );
wmsTitleElem.appendChild( wmsTitleText );
parentElement.appendChild( wmsTitleElem );
serviceElem.appendChild( wmsTitleElem );
}

//WMS abstract
@@ -1289,7 +1291,7 @@ void QgsProjectParser::serviceCapabilities( QDomElement& parentElement, QDomDocu
QDomElement wmsAbstractElem = doc.createElement( "Abstract" );
QDomText wmsAbstractText = doc.createTextNode( abstractElem.text() );
wmsAbstractElem.appendChild( wmsAbstractText );
parentElement.appendChild( wmsAbstractElem );
serviceElem.appendChild( wmsAbstractElem );
}

//Contact information
@@ -1344,7 +1346,8 @@ void QgsProjectParser::serviceCapabilities( QDomElement& parentElement, QDomDocu
contactInfoElem.appendChild( wmsMailElem );
}

parentElement.appendChild( contactInfoElem );
serviceElem.appendChild( contactInfoElem );
parentElement.appendChild( serviceElem );
}

QString QgsProjectParser::convertToAbsolutePath( const QString& file ) const

0 comments on commit 62e62f6

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