Skip to content
Permalink
Browse files

Misc clazy fixes

  • Loading branch information
nyalldawson committed Sep 25, 2017
1 parent 6c74502 commit f952e6a6477751a598612db21750c1deae336cfb
@@ -162,7 +162,7 @@ class CORE_EXPORT QgsAtlasComposition : public QObject
* \note This property is only used for image exports.
* \since QGIS 3.0
*/
void setFileFormat( QString format ) { mFileFormat = format; }
void setFileFormat( const QString &format ) { mFileFormat = format; }

bool sortFeatures() const { return mSortFeatures; }
void setSortFeatures( bool doSort ) { mSortFeatures = doSort; }
@@ -190,7 +190,7 @@ void QgsGPSDetector::advance()
connect( mConn, &QObject::destroyed, this, &QgsGPSDetector::connDestroyed );

// leave 2s to pickup a valid string
QTimer::singleShot( 2000, this, SLOT( advance() ) );
QTimer::singleShot( 2000, this, &QgsGPSDetector::advance );
}

void QgsGPSDetector::detected( const QgsGPSInformation &info )
@@ -184,7 +184,7 @@ class CORE_EXPORT QgsRenderContext
* Will be used to convert meter distances to active MapUnit values for QgsUnitTypes::RenderMetersInMapUnits
* \since QGIS 3.0
*/
void setDistanceArea( const QgsDistanceArea distanceArea ) {mDistanceArea = distanceArea ;}
void setDistanceArea( const QgsDistanceArea &distanceArea ) {mDistanceArea = distanceArea ;}

/**
* Sets the scaling factor for the render to convert painter units
@@ -45,7 +45,8 @@ bool QgsVectorLayerEditPassthrough::addFeature( QgsFeature &f )
if ( !modify( cmd ) ) // modify takes owneship -> no need for cmd to be a smart ptr
return false;

f = cmd->features().last();
const QgsFeatureList features = cmd->features();
f = features.at( features.count() - 1 );
return true;
}

@@ -89,7 +89,7 @@ void QgsInvertedPolygonRenderer::checkLegendSymbolItem( const QString &key, bool
if ( !mSubRenderer )
return;

return mSubRenderer->checkLegendSymbolItem( key, state );
mSubRenderer->checkLegendSymbolItem( key, state );
}

void QgsInvertedPolygonRenderer::startRender( QgsRenderContext &context, const QgsFields &fields )
@@ -2193,7 +2193,7 @@ void QgsMapCanvas::schedulePreviewJob( int number )
mPreviewTimer.setSingleShot( true );
mPreviewTimer.setInterval( 250 );
disconnect( mPreviewTimerConnection );
mPreviewTimerConnection = connect( &mPreviewTimer, &QTimer::timeout, [ = ]()
mPreviewTimerConnection = connect( &mPreviewTimer, &QTimer::timeout, this, [ = ]()
{
startPreviewJob( number );
}
@@ -515,7 +515,7 @@ bool QgsMetadataWidget::checkMetadata() const
if ( results == false )
{
errors = QStringLiteral();
for ( const QgsMetadataValidator::ValidationResult &result : validationResults )
for ( const QgsMetadataValidator::ValidationResult &result : qgsAsConst( validationResults ) )
{
errors += QLatin1String( "<b>" ) % result.section;
if ( ! result.identifier.isNull() )
@@ -2472,7 +2472,7 @@ bool QgsPostgresProvider::deleteAttributes( const QgsAttributeIds &ids )
QList<int> idsList = ids.values();
std::sort( idsList.begin(), idsList.end(), std::greater<int>() );

for ( QList<int>::const_iterator iter = idsList.begin(); iter != idsList.end(); ++iter )
for ( auto iter = idsList.constBegin(); iter != idsList.constEnd(); ++iter )
{
int index = *iter;
if ( index < 0 || index >= mAttributeFields.count() )

0 comments on commit f952e6a

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