Skip to content
Permalink
Browse files
[Server] Fix QgsServerProjectUtils readListEntry
  • Loading branch information
rldhont committed May 26, 2017
1 parent 0f00a52 commit 6feca53278c8c0136df17428c42494dbaa387bd8
Showing with 27 additions and 5 deletions.
  1. +27 −2 src/server/qgsserverprojectutils.cpp
  2. +0 −3 tests/testdata/qgis_server/wcs_getcapabilities.txt
@@ -34,7 +34,20 @@ QString QgsServerProjectUtils::owsServiceAbstract( const QgsProject &project )

QStringList QgsServerProjectUtils::owsServiceKeywords( const QgsProject &project )
{
return project.readListEntry( QStringLiteral( "WMSKeywordList" ), QStringLiteral( "/" ) );
QStringList keywordList;
QStringList list = project.readListEntry( QStringLiteral( "WMSKeywordList" ), QStringLiteral( "/" ), QStringList() );
if ( !list.isEmpty() )
{
for ( int i = 0; i < list.size(); ++i )
{
QString keyword = list.at( i );
if ( !keyword.isEmpty() )
{
keywordList.append( keyword );
}
}
}
return keywordList;
}

QString QgsServerProjectUtils::owsServiceOnlineResource( const QgsProject &project )
@@ -141,7 +154,19 @@ QStringList QgsServerProjectUtils::wmsRestrictedComposers( const QgsProject &pro

QStringList QgsServerProjectUtils::wmsOutputCrsList( const QgsProject &project )
{
QStringList crsList = project.readListEntry( QStringLiteral( "WMSCrsList" ), QStringLiteral( "/" ), QStringList() );
QStringList crsList;
QStringList wmsCrsList = project.readListEntry( QStringLiteral( "WMSCrsList" ), QStringLiteral( "/" ), QStringList() );
if ( !wmsCrsList.isEmpty() )
{
for ( int i = 0; i < wmsCrsList.size(); ++i )
{
QString crs = wmsCrsList.at( i );
if ( !crs.isEmpty() )
{
crsList.append( crs );
}
}
}
if ( crsList.isEmpty() )
{
QStringList valueList = project.readListEntry( QStringLiteral( "WMSEpsgList" ), QStringLiteral( "/" ), QStringList() );
@@ -6,9 +6,6 @@ Content-Type: text/xml; charset=utf-8
<name>WCS</name>
<label>QGIS Server test</label>
<description><![CDATA[Simple test app.]]></description>
<keywords>
<keyword></keyword>
</keywords>
<responsibleParty>
<individualName>Stéphane Brunner</individualName>
<organisationName>QGIS</organisationName>

0 comments on commit 6feca53

Please sign in to comment.