Skip to content
Permalink
Browse files
Use filename for title of WMS top layer if project title empty (ticket
…#3719)

git-svn-id: http://svn.osgeo.org/qgis/trunk@15695 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Apr 12, 2011
1 parent 97b72c7 commit 8a31ca5d75127456ce2ea0d24a4591250dd48f53
Showing with 11 additions and 3 deletions.
  1. +11 −3 src/mapserver/qgsprojectparser.cpp
@@ -33,6 +33,8 @@
#include "qgscomposerscalebar.h"
#include "qgscomposershape.h"

#include "QFileInfo"


QgsProjectParser::QgsProjectParser( QDomDocument* xmlDoc, const QString& filePath ): QgsConfigParser(), mXMLDoc( xmlDoc ), mProjectPath( filePath )
{
@@ -621,12 +623,18 @@ QString QgsProjectParser::projectTitle() const
}

QDomElement titleElem = qgisElem.firstChildElement( "title" );
if ( titleElem.isNull() )
if ( !titleElem.isNull() )
{
return QString();
QString title = titleElem.text();
if ( !title.isEmpty() )
{
return title;
}
}

return titleElem.text();
//no title element or not project title set. Use project filename without extension
QFileInfo projectFileInfo( mProjectPath );
return projectFileInfo.baseName();
}

QList<QDomElement> QgsProjectParser::projectLayerElements() const

0 comments on commit 8a31ca5

Please sign in to comment.