File tree 2 files changed +9
-11
lines changed
2 files changed +9
-11
lines changed Original file line number Diff line number Diff line change @@ -1076,10 +1076,9 @@ void QgsOptions::saveOptions()
1076
1076
settings.setValue ( " /qgis/enable_anti_aliasing" , chkAntiAliasing->isChecked () );
1077
1077
settings.setValue ( " /qgis/enable_render_caching" , chkUseRenderCaching->isChecked () );
1078
1078
settings.setValue ( " /qgis/parallel_rendering" , chkParallelRendering->isChecked () );
1079
- if ( chkMaxThreads->isChecked () )
1080
- QgsApplication::setMaxThreads ( spinMaxThreads->value () );
1081
- else
1082
- QgsApplication::setMaxThreads ( -1 );
1079
+ int maxThreads = chkMaxThreads->isChecked () ? spinMaxThreads->value () : -1 ;
1080
+ QgsApplication::setMaxThreads ( maxThreads );
1081
+ settings.setValue ( " /qgis/max_threads" , maxThreads );
1083
1082
1084
1083
settings.setValue ( " /qgis/map_update_interval" , spinMapUpdateInterval->value () );
1085
1084
settings.setValue ( " /qgis/legendDoubleClickAction" , cmbLegendDoubleClickAction->currentIndex () );
Original file line number Diff line number Diff line change @@ -1023,25 +1023,24 @@ bool QgsApplication::createDB( QString *errorMessage )
1023
1023
return true ;
1024
1024
}
1025
1025
1026
- void QgsApplication::setMaxThreads ( int maxThreads )
1027
- {
1028
- qDebug ( " max threads : %d " , maxThreads);
1026
+ void QgsApplication::setMaxThreads ( int maxThreads )
1027
+ {
1028
+ QgsDebugMsg ( QString ( " maxThreads : %1 " ). arg ( maxThreads ) );
1029
1029
1030
1030
// make sure value is between 1 and #cores, if not set to -1 (use #cores)
1031
1031
// 0 could be used to disable any parallel processing
1032
1032
if ( maxThreads < 1 || maxThreads > QThread::idealThreadCount () )
1033
- maxThreads = -1 ;
1033
+ maxThreads = -1 ;
1034
1034
1035
1035
// save value
1036
1036
ABISYM ( mMaxThreads ) = maxThreads;
1037
- QSettings ().setValue ( " /qgis/max_threads" , maxThreads );
1038
1037
1039
1038
// if -1 use #cores
1040
1039
if ( maxThreads == -1 )
1041
- maxThreads = QThread::idealThreadCount ();
1040
+ maxThreads = QThread::idealThreadCount ();
1042
1041
1043
1042
// set max thread count in QThreadPool
1044
1043
QThreadPool::globalInstance ()->setMaxThreadCount ( maxThreads );
1045
- qDebug ( " set QThreadPool max thread count to %d" , QThreadPool::globalInstance ()->maxThreadCount () );
1044
+ QgsDebugMsg ( QString ( " set QThreadPool max thread count to %d" ). arg ( QThreadPool::globalInstance ()->maxThreadCount () ) );
1046
1045
}
1047
1046
You can’t perform that action at this time.
0 commit comments