Skip to content

Commit

Permalink
Fix clang-tidy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Mar 10, 2019
1 parent a14ddc8 commit cc08771
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/app/qgsvectorlayerproperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ QgsVectorLayerProperties::QgsVectorLayerProperties(

if ( mLayer->dataProvider() )//enable spatial index button group if supported by provider
{
int capabilities = mLayer->dataProvider()->capabilities();
QgsVectorDataProvider::Capabilities capabilities = mLayer->dataProvider()->capabilities();
if ( !( capabilities & QgsVectorDataProvider::CreateSpatialIndex ) )
{
pbnIndex->setEnabled( false );
Expand Down Expand Up @@ -1669,7 +1669,7 @@ void QgsVectorLayerProperties::updateAuxiliaryStoragePage()
mAuxiliaryStorageKeyLineEdit->setText( alayer->joinInfo().targetFieldName() );

// update feature count
int features = alayer->featureCount();
long features = alayer->featureCount();
mAuxiliaryStorageFeaturesLineEdit->setText( QString::number( features ) );

// update actions
Expand Down
7 changes: 4 additions & 3 deletions src/core/qgsmaprendererjob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ bool QgsMapRendererJob::prepareLabelCache() const

// calculate which layers will be labeled
QSet< QgsMapLayer * > labeledLayers;
Q_FOREACH ( const QgsMapLayer *ml, mSettings.layers() )
const QList<QgsMapLayer *> layers = mSettings.layers();
for ( const QgsMapLayer *ml : layers )
{
QgsVectorLayer *vl = const_cast< QgsVectorLayer * >( qobject_cast<const QgsVectorLayer *>( ml ) );
if ( vl && QgsPalLabeling::staticWillUseLayer( vl ) )
Expand Down Expand Up @@ -314,7 +315,7 @@ LayerRenderJobs QgsMapRendererJob::prepareJobs( QPainter *painter, QgsLabelingEn
job.cached = true;
job.imageInitialized = true;
job.img = new QImage( mCache->cacheImage( ml->id() ) );
job.img->setDevicePixelRatio( mSettings.devicePixelRatio() );
job.img->setDevicePixelRatio( static_cast<qreal>( mSettings.devicePixelRatio() ) );
job.renderer = nullptr;
job.context.setPainter( nullptr );
continue;
Expand All @@ -328,7 +329,7 @@ LayerRenderJobs QgsMapRendererJob::prepareJobs( QPainter *painter, QgsLabelingEn
// Flattened image for drawing when a blending mode is set
QImage *mypFlattenedImage = new QImage( mSettings.deviceOutputSize(),
mSettings.outputImageFormat() );
mypFlattenedImage->setDevicePixelRatio( mSettings.devicePixelRatio() );
mypFlattenedImage->setDevicePixelRatio( static_cast<qreal>( mSettings.devicePixelRatio() ) );
if ( mypFlattenedImage->isNull() )
{
mErrors.append( Error( ml->id(), tr( "Insufficient memory for image %1x%2" ).arg( mSettings.outputSize().width() ).arg( mSettings.outputSize().height() ) ) );
Expand Down

0 comments on commit cc08771

Please sign in to comment.