Skip to content
Permalink
Browse files

Fix some clazy warnings

  • Loading branch information
nyalldawson committed Apr 3, 2018
1 parent d5d553f commit 20c5e5415de34fb7e0ae1cddf344430b8a008c48
Showing with 8 additions and 7 deletions.
  1. +4 −4 src/core/layout/qgsabstractreportsection.cpp
  2. +4 −3 src/providers/arcgisrest/qgsafsshareddata.cpp
@@ -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" ) );
@@ -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() )
{
@@ -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() );
@@ -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;
}

@@ -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;
}

@@ -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 )

0 comments on commit 20c5e54

Please sign in to comment.
You can’t perform that action at this time.