Skip to content

Commit

Permalink
Remove more redundant checks
Browse files Browse the repository at this point in the history
  • Loading branch information
pathmapper committed Sep 28, 2021
1 parent 8e48ac5 commit 596c92d
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 38 deletions.
2 changes: 0 additions & 2 deletions src/server/services/landingpage/qgslandingpageutils.cpp
Expand Up @@ -294,8 +294,6 @@ json QgsLandingPageUtils::projectInfo( const QString &projectUri, const QgsServe
QString title { p->metadata().title() };
if ( title.isEmpty() )
title = QgsServerProjectUtils::owsServiceTitle( *p );
if ( title.isEmpty() )
title = p->baseName();
info["title"] = title.toStdString();
// Description
QString description { p->metadata().abstract() };
Expand Down
11 changes: 4 additions & 7 deletions src/server/services/wcs/qgswcsgetcapabilities.cpp
Expand Up @@ -142,13 +142,10 @@ namespace QgsWcs
serviceElem.appendChild( nameElem );

const QString title = QgsServerProjectUtils::owsServiceTitle( *project );
if ( !title.isEmpty() )
{
QDomElement titleElem = doc.createElement( QStringLiteral( "label" ) );
const QDomText titleText = doc.createTextNode( title );
titleElem.appendChild( titleText );
serviceElem.appendChild( titleElem );
}
QDomElement titleElem = doc.createElement( QStringLiteral( "label" ) );
const QDomText titleText = doc.createTextNode( title );
titleElem.appendChild( titleText );
serviceElem.appendChild( titleElem );

const QString abstract = QgsServerProjectUtils::owsServiceAbstract( *project );
if ( !abstract.isEmpty() )
Expand Down
11 changes: 4 additions & 7 deletions src/server/services/wfs/qgswfsgetcapabilities.cpp
Expand Up @@ -170,13 +170,10 @@ namespace QgsWfs
QDomElement serviceElem = doc.createElement( QStringLiteral( "ows:ServiceIdentification" ) );

const QString title = QgsServerProjectUtils::owsServiceTitle( *project );
if ( !title.isEmpty() )
{
QDomElement titleElem = doc.createElement( QStringLiteral( "ows:Title" ) );
const QDomText titleText = doc.createTextNode( title );
titleElem.appendChild( titleText );
serviceElem.appendChild( titleElem );
}
QDomElement titleElem = doc.createElement( QStringLiteral( "ows:Title" ) );
const QDomText titleText = doc.createTextNode( title );
titleElem.appendChild( titleText );
serviceElem.appendChild( titleElem );

const QString abstract = QgsServerProjectUtils::owsServiceAbstract( *project );
if ( !abstract.isEmpty() )
Expand Down
11 changes: 4 additions & 7 deletions src/server/services/wfs/qgswfsgetcapabilities_1_0_0.cpp
Expand Up @@ -141,13 +141,10 @@ namespace QgsWfs
serviceElem.appendChild( nameElem );

const QString title = QgsServerProjectUtils::owsServiceTitle( *project );
if ( !title.isEmpty() )
{
QDomElement titleElem = doc.createElement( QStringLiteral( "Title" ) );
const QDomText titleText = doc.createTextNode( title );
titleElem.appendChild( titleText );
serviceElem.appendChild( titleElem );
}
QDomElement titleElem = doc.createElement( QStringLiteral( "Title" ) );
const QDomText titleText = doc.createTextNode( title );
titleElem.appendChild( titleText );
serviceElem.appendChild( titleElem );

const QString abstract = QgsServerProjectUtils::owsServiceAbstract( *project );
if ( !abstract.isEmpty() )
Expand Down
12 changes: 4 additions & 8 deletions src/server/services/wms/qgswmsgetcontext.cpp
Expand Up @@ -135,15 +135,11 @@ namespace QgsWms
generalElem.appendChild( windowElem );

//OWS title
//why not use project title ?
const QString title = QgsServerProjectUtils::owsServiceTitle( *project );
if ( !title.isEmpty() )
{
QDomElement titleElem = doc.createElement( QStringLiteral( "ows:Title" ) );
const QDomText titleText = doc.createTextNode( title );
titleElem.appendChild( titleText );
generalElem.appendChild( titleElem );
}
QDomElement titleElem = doc.createElement( QStringLiteral( "ows:Title" ) );
const QDomText titleText = doc.createTextNode( title );
titleElem.appendChild( titleText );
generalElem.appendChild( titleElem );

//OWS abstract
const QString abstract = QgsServerProjectUtils::owsServiceAbstract( *project );
Expand Down
11 changes: 4 additions & 7 deletions src/server/services/wmts/qgswmtsgetcapabilities.cpp
Expand Up @@ -124,13 +124,10 @@ namespace QgsWmts
serviceElem.appendChild( typeVersionElem );

const QString title = QgsServerProjectUtils::owsServiceTitle( *project );
if ( !title.isEmpty() )
{
QDomElement titleElem = doc.createElement( QStringLiteral( "ows:Title" ) );
const QDomText titleText = doc.createTextNode( title );
titleElem.appendChild( titleText );
serviceElem.appendChild( titleElem );
}
QDomElement titleElem = doc.createElement( QStringLiteral( "ows:Title" ) );
const QDomText titleText = doc.createTextNode( title );
titleElem.appendChild( titleText );
serviceElem.appendChild( titleElem );

const QString abstract = QgsServerProjectUtils::owsServiceAbstract( *project );
if ( !abstract.isEmpty() )
Expand Down

0 comments on commit 596c92d

Please sign in to comment.