From ca8d82ff4cbd337f37fdbf12508b706f65a238f7 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Thu, 16 Nov 2017 00:27:39 +0100 Subject: [PATCH] Add a setting to be able to disable preview jobs in main canvas 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 https://github.com/qgis/QGIS/pull/5645 and https://lists.osgeo.org/pipermail/qgis-developer/2017-November/050524.html, but at least offer this setting for now, pending further improvements. --- src/app/qgisapp.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/app/qgisapp.cpp b/src/app/qgisapp.cpp index 42223f6376a..809c7b45f11 100644 --- a/src/app/qgisapp.cpp +++ b/src/app/qgisapp.cpp @@ -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();