Skip to content

Commit

Permalink
Skip layers with 'rendering/noPreviewJobs' custom property set in pre…
Browse files Browse the repository at this point in the history
…fetch preview jobs
  • Loading branch information
nyalldawson committed Dec 20, 2022
1 parent dfe38ed commit d30a7be
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/gui/qgsmapcanvas.cpp
Expand Up @@ -3147,6 +3147,11 @@ void QgsMapCanvas::startPreviewJob( int number )
context.maxRenderingTimeMs = MAXIMUM_LAYER_PREVIEW_TIME_MS;
for ( QgsMapLayer *layer : layers )
{
if ( layer->customProperty( QStringLiteral( "rendering/noPreviewJobs" ), false ).toBool() )
{
QgsDebugMsgLevel( QStringLiteral( "Layer %1 not rendered because it is explicitly blocked from preview jobs" ).arg( layer->id() ), 3 );
continue;
}
context.lastRenderingTimeMs = mLastLayerRenderTime.value( layer->id(), 0 );
QgsDataProvider *provider = layer->dataProvider();
if ( provider && !provider->renderInPreview( context ) )
Expand Down

0 comments on commit d30a7be

Please sign in to comment.