Skip to content

Commit 7b49032

Browse files
committed
Update for loop
1 parent 0a38003 commit 7b49032

File tree

1 file changed

+9
-14
lines changed

1 file changed

+9
-14
lines changed

src/server/services/wms/qgswmsgetcapabilities.cpp

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1732,26 +1732,21 @@ namespace QgsWms
17321732
keywordsElem.appendChild( keywordElem );
17331733
parent.appendChild( keywordsElem );
17341734
QStringList keywords = QgsServerProjectUtils::owsServiceKeywords( *project );
1735-
if ( !keywords.isEmpty() )
1735+
for ( const QString &keyword : qgis::as_const( keywords ) )
17361736
{
1737-
for ( int i = 0; i < keywords.size(); ++i )
1737+
if ( !keyword.isEmpty() )
17381738
{
1739-
QString keyword = keywords.at( i );
1740-
if ( !keyword.isEmpty() )
1739+
keywordElem = doc.createElement( QStringLiteral( "Keyword" ) );
1740+
keywordText = doc.createTextNode( keyword );
1741+
keywordElem.appendChild( keywordText );
1742+
if ( sia2045 )
17411743
{
1742-
keywordElem = doc.createElement( QStringLiteral( "Keyword" ) );
1743-
keywordText = doc.createTextNode( keyword );
1744-
keywordElem.appendChild( keywordText );
1745-
if ( sia2045 )
1746-
{
1747-
keywordElem.setAttribute( QStringLiteral( "vocabulary" ), QStringLiteral( "SIA_Geo405" ) );
1748-
}
1749-
keywordsElem.appendChild( keywordElem );
1744+
keywordElem.setAttribute( QStringLiteral( "vocabulary" ), QStringLiteral( "SIA_Geo405" ) );
17501745
}
1746+
keywordsElem.appendChild( keywordElem );
17511747
}
1752-
1753-
parent.appendChild( keywordsElem );
17541748
}
1749+
parent.appendChild( keywordsElem );
17551750
}
17561751
}
17571752

0 commit comments

Comments
 (0)