Skip to content

Commit

Permalink
Fix some clazy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Apr 3, 2018
1 parent d5d553f commit 20c5e54
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/core/layout/qgsabstractreportsection.cpp
Expand Up @@ -77,14 +77,14 @@ bool QgsAbstractReportSection::writeXml( QDomElement &parentElement, QDomDocumen
QDomElement element = doc.createElement( QStringLiteral( "Section" ) );
element.setAttribute( QStringLiteral( "type" ), type() );

element.setAttribute( QStringLiteral( "headerEnabled" ), mHeaderEnabled ? "1" : "0" );
element.setAttribute( QStringLiteral( "headerEnabled" ), mHeaderEnabled ? QStringLiteral( "1" ) : QStringLiteral( "0" ) );
if ( mHeader )
{
QDomElement headerElement = doc.createElement( QStringLiteral( "header" ) );
headerElement.appendChild( mHeader->writeXml( doc, context ) );
element.appendChild( headerElement );
}
element.setAttribute( QStringLiteral( "footerEnabled" ), mFooterEnabled ? "1" : "0" );
element.setAttribute( QStringLiteral( "footerEnabled" ), mFooterEnabled ? QStringLiteral( "1" ) : QStringLiteral( "0" ) );
if ( mFooter )
{
QDomElement footerElement = doc.createElement( QStringLiteral( "footer" ) );
Expand All @@ -110,8 +110,8 @@ bool QgsAbstractReportSection::readXml( const QDomElement &element, const QDomDo
return false;
}

mHeaderEnabled = element.attribute( QStringLiteral( "headerEnabled" ), "0" ).toInt();
mFooterEnabled = element.attribute( QStringLiteral( "footerEnabled" ), "0" ).toInt();
mHeaderEnabled = element.attribute( QStringLiteral( "headerEnabled" ), QStringLiteral( "0" ) ).toInt();
mFooterEnabled = element.attribute( QStringLiteral( "footerEnabled" ), QStringLiteral( "0" ) ).toInt();
const QDomElement headerElement = element.firstChildElement( QStringLiteral( "header" ) );
if ( !headerElement.isNull() )
{
Expand Down
7 changes: 4 additions & 3 deletions src/providers/arcgisrest/qgsafsshareddata.cpp
Expand Up @@ -39,6 +39,7 @@ bool QgsAfsSharedData::getFeature( QgsFeatureId id, QgsFeature &f, const QgsRect
QStringList fetchAttribNames;
QList<int> fetchAttribIdx;
fetchAttribIdx.reserve( mFields.size() );
fetchAttribNames.reserve( mFields.size() );
for ( int idx = 0, n = mFields.size(); idx < n; ++idx )
{
fetchAttribNames.append( mFields.at( idx ).name() );
Expand All @@ -58,7 +59,7 @@ bool QgsAfsSharedData::getFeature( QgsFeatureId id, QgsFeature &f, const QgsRect

if ( objectIds.empty() )
{
QgsDebugMsg( "No valid features IDs to fetch" );
QgsDebugMsg( QStringLiteral( "No valid features IDs to fetch" ) );
return false;
}

Expand All @@ -75,7 +76,7 @@ bool QgsAfsSharedData::getFeature( QgsFeatureId id, QgsFeature &f, const QgsRect
if ( queryData.isEmpty() )
{
// const_cast<QgsAfsProvider *>( this )->pushError( errorTitle + ": " + errorMessage );
QgsDebugMsg( "Query returned empty result" );
QgsDebugMsg( QStringLiteral( "Query returned empty result" ) );
return false;
}

Expand All @@ -84,7 +85,7 @@ bool QgsAfsSharedData::getFeature( QgsFeatureId id, QgsFeature &f, const QgsRect
const QVariantList featuresData = queryData[QStringLiteral( "features" )].toList();
if ( featuresData.isEmpty() )
{
QgsDebugMsgLevel( "Query returned no features", 3 );
QgsDebugMsgLevel( QStringLiteral( "Query returned no features" ), 3 );
return false;
}
for ( int i = 0, n = featuresData.size(); i < n; ++i )
Expand Down

0 comments on commit 20c5e54

Please sign in to comment.