Skip to content

Commit

Permalink
Add a setting to be able to disable preview jobs in main canvas
Browse files Browse the repository at this point in the history
Can be used by power users to disable preview jobs, for very slow datasources
(especially when network bandwidth is saturated), where it decreases performance.

More clever approaches have been discussed per #5645
and https://lists.osgeo.org/pipermail/qgis-developer/2017-November/050524.html,
but at least offer this setting for now, pending further improvements.
  • Loading branch information
rouault committed Nov 15, 2017
1 parent 581d0d3 commit ca8d82f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/app/qgisapp.cpp
Expand Up @@ -717,7 +717,13 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, bool skipVersionCh
connect( mMapCanvas, &QgsMapCanvas::messageEmitted, this, &QgisApp::displayMessage );
mMapCanvas->setWhatsThis( tr( "Map canvas. This is where raster and vector "
"layers are displayed when added to the map" ) );
mMapCanvas->setPreviewJobsEnabled( true );

if ( settings.value( QStringLiteral( "qgis/main_canvas_preview_jobs" ) ).isNull() )
{
// So that it appears in advanced settings
settings.setValue( QStringLiteral( "qgis/main_canvas_preview_jobs" ), true );
}
mMapCanvas->setPreviewJobsEnabled( settings.value( QStringLiteral( "qgis/main_canvas_preview_jobs" ), true ).toBool() );

// set canvas color right away
int myRed = settings.value( QStringLiteral( "qgis/default_canvas_color_red" ), 255 ).toInt();
Expand Down

0 comments on commit ca8d82f

Please sign in to comment.