Skip to content

Commit

Permalink
Merge pull request #45282 from pathmapper/empty_check
Browse files Browse the repository at this point in the history
Remove redundant check
  • Loading branch information
elpaso committed Oct 1, 2021
2 parents 994d1a4 + 596c92d commit 97884ad
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 40 deletions.
4 changes: 0 additions & 4 deletions src/server/services/landingpage/qgslandingpageutils.cpp
Expand Up @@ -294,10 +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->title();
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 97884ad

Please sign in to comment.