@@ -171,8 +171,8 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl, const QList<QgsOpti
171
171
mRemoveCustomVarBtn ->setEnabled ( false );
172
172
mCustomVariablesTable ->setEnabled ( false );
173
173
}
174
- QStringList customVarsList = mSettings ->value ( QStringLiteral ( " qgis/customEnvVars" ) ).toStringList ();
175
- Q_FOREACH ( const QString &varStr, customVarsList )
174
+ const QStringList customVarsList = mSettings ->value ( QStringLiteral ( " qgis/customEnvVars" ) ).toStringList ();
175
+ for ( const QString &varStr : customVarsList )
176
176
{
177
177
int pos = varStr.indexOf ( QLatin1Char ( ' |' ) );
178
178
if ( pos == -1 )
@@ -204,9 +204,9 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl, const QList<QgsOpti
204
204
// current environment variables
205
205
mCurrentVariablesTable ->horizontalHeader ()->setFixedHeight ( fmCustomVarH );
206
206
QMap<QString, QString> sysVarsMap = QgsApplication::systemEnvVars ();
207
- QStringList currentVarsList = QProcess::systemEnvironment ();
207
+ const QStringList currentVarsList = QProcess::systemEnvironment ();
208
208
209
- Q_FOREACH ( const QString &varStr, currentVarsList )
209
+ for ( const QString &varStr : currentVarsList )
210
210
{
211
211
int pos = varStr.indexOf ( QLatin1Char ( ' =' ) );
212
212
if ( pos == -1 )
@@ -254,49 +254,44 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl, const QList<QgsOpti
254
254
mCurrentVariablesTable ->resizeColumnToContents ( 0 );
255
255
256
256
// local directories to search when loading c++ plugins
257
- QStringList pathList = mSettings ->value ( QStringLiteral ( " plugins/searchPathsForPlugins" ) ).toStringList ();
258
- Q_FOREACH ( const QString &path, pathList )
257
+ const QStringList pluginsPathList = mSettings ->value ( QStringLiteral ( " plugins/searchPathsForPlugins" ) ).toStringList ();
258
+ for ( const QString &path : pluginsPathList )
259
259
{
260
260
QListWidgetItem *newItem = new QListWidgetItem ( mListPluginPaths );
261
261
newItem->setText ( path );
262
262
newItem->setFlags ( Qt::ItemIsEditable | Qt::ItemIsEnabled | Qt::ItemIsSelectable );
263
263
mListPluginPaths ->addItem ( newItem );
264
264
}
265
265
connect ( mBtnAddPluginPath , &QAbstractButton::clicked, this , &QgsOptions::addPluginPath );
266
+ connect ( mBtnRemovePluginPath , &QAbstractButton::clicked, this , &QgsOptions::removePluginPath );
266
267
267
268
// local directories to search when looking for an SVG with a given basename
268
- pathList = QgsApplication::svgPaths ();
269
- if ( !pathList. isEmpty () )
269
+ const QStringList svgPathList = QgsApplication::svgPaths ();
270
+ for ( const QString &path : svgPathList )
270
271
{
271
- Q_FOREACH ( const QString &path, pathList )
272
- {
273
- QListWidgetItem *newItem = new QListWidgetItem ( mListSVGPaths );
274
- newItem->setText ( path );
275
- newItem->setFlags ( Qt::ItemIsEditable | Qt::ItemIsEnabled | Qt::ItemIsSelectable );
276
- mListSVGPaths ->addItem ( newItem );
277
- }
272
+ QListWidgetItem *newItem = new QListWidgetItem ( mListSVGPaths );
273
+ newItem->setText ( path );
274
+ newItem->setFlags ( Qt::ItemIsEditable | Qt::ItemIsEnabled | Qt::ItemIsSelectable );
275
+ mListSVGPaths ->addItem ( newItem );
278
276
}
279
277
connect ( mBtnAddSVGPath , &QAbstractButton::clicked, this , &QgsOptions::addSVGPath );
280
278
connect ( mBtnRemoveSVGPath , &QAbstractButton::clicked, this , &QgsOptions::removeSVGPath );
281
279
282
280
// local directories to search when looking for a composer templates
283
- pathList = QgsApplication::composerTemplatePaths ();
284
- if ( !pathList. isEmpty () )
281
+ const QStringList composerTemplatePathList = QgsApplication::composerTemplatePaths ();
282
+ for ( const QString &path : composerTemplatePathList )
285
283
{
286
- Q_FOREACH ( const QString &path, pathList )
287
- {
288
- QListWidgetItem *newItem = new QListWidgetItem ( mListComposerTemplatePaths );
289
- newItem->setText ( path );
290
- newItem->setFlags ( Qt::ItemIsEditable | Qt::ItemIsEnabled | Qt::ItemIsSelectable );
291
- mListComposerTemplatePaths ->addItem ( newItem );
292
- }
284
+ QListWidgetItem *newItem = new QListWidgetItem ( mListComposerTemplatePaths );
285
+ newItem->setText ( path );
286
+ newItem->setFlags ( Qt::ItemIsEditable | Qt::ItemIsEnabled | Qt::ItemIsSelectable );
287
+ mListComposerTemplatePaths ->addItem ( newItem );
293
288
}
294
289
connect ( mBtnAddTemplatePath , &QAbstractButton::clicked, this , &QgsOptions::addTemplatePath );
295
290
connect ( mBtnRemoveTemplatePath , &QAbstractButton::clicked, this , &QgsOptions::removeTemplatePath );
296
291
297
292
// paths hidden from browser
298
- pathList = mSettings ->value ( QStringLiteral ( " /browser/hiddenPaths" ) ).toStringList ();
299
- Q_FOREACH ( const QString &path, pathList )
293
+ const QStringList hiddenPathList = mSettings ->value ( QStringLiteral ( " /browser/hiddenPaths" ) ).toStringList ();
294
+ for ( const QString &path : hiddenPathList )
300
295
{
301
296
QListWidgetItem *newItem = new QListWidgetItem ( mListHiddenBrowserPaths );
302
297
newItem->setText ( path );
@@ -305,8 +300,8 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl, const QList<QgsOpti
305
300
connect ( mBtnRemoveHiddenPath , &QAbstractButton::clicked, this , &QgsOptions::removeHiddenPath );
306
301
307
302
// locations of the QGIS help
308
- QStringList helpPathList = mSettings ->value ( QStringLiteral ( " help/helpSearchPath" ), " http://docs.qgis.org/$qgis_short_version/$qgis_locale/docs/user_manual/" ).toStringList ();
309
- Q_FOREACH ( const QString &path, helpPathList )
303
+ const QStringList helpPathList = mSettings ->value ( QStringLiteral ( " help/helpSearchPath" ), " http://docs.qgis.org/$qgis_short_version/$qgis_locale/docs/user_manual/" ).toStringList ();
304
+ for ( const QString &path : helpPathList )
310
305
{
311
306
QTreeWidgetItem *item = new QTreeWidgetItem ();
312
307
item->setText ( 0 , path );
@@ -355,8 +350,8 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl, const QList<QgsOpti
355
350
mProxyTypeComboBox ->setCurrentIndex ( mProxyTypeComboBox ->findText ( settingProxyType ) );
356
351
357
352
// URLs excluded not going through proxies
358
- pathList = mSettings ->value ( QStringLiteral ( " proxy/proxyExcludedUrls" ) ).toStringList ();
359
- Q_FOREACH ( const QString &path, pathList )
353
+ const QStringList excludedUrlPathList = mSettings ->value ( QStringLiteral ( " proxy/proxyExcludedUrls" ) ).toStringList ();
354
+ for ( const QString &path : excludedUrlPathList )
360
355
{
361
356
QListWidgetItem *newItem = new QListWidgetItem ( mExcludeUrlListWidget );
362
357
newItem->setText ( path );
@@ -787,11 +782,11 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl, const QList<QgsOpti
787
782
setZoomFactorValue ();
788
783
789
784
// predefined scales for scale combobox
790
- QString myPaths = mSettings ->value ( QStringLiteral ( " Map/scales" ), PROJECT_SCALES ).toString ();
791
- if ( !myPaths .isEmpty () )
785
+ QString scalePaths = mSettings ->value ( QStringLiteral ( " Map/scales" ), PROJECT_SCALES ).toString ();
786
+ if ( !scalePaths .isEmpty () )
792
787
{
793
- QStringList myScalesList = myPaths .split ( ' ,' );
794
- Q_FOREACH ( const QString &scale, myScalesList )
788
+ const QStringList ScalesList = scalePaths .split ( ' ,' );
789
+ for ( const QString &scale : ScalesList )
795
790
{
796
791
addScaleToScaleList ( scale );
797
792
}
@@ -1182,7 +1177,7 @@ void QgsOptions::saveOptions()
1182
1177
{
1183
1178
pathsList << mListPluginPaths ->item ( i )->text ();
1184
1179
}
1185
- mSettings ->setValue ( QStringLiteral ( " help/helpSearchPath " ), pathsList );
1180
+ mSettings ->setValue ( QStringLiteral ( " plugins/searchPathsForPlugins " ), pathsList );
1186
1181
1187
1182
// search directories for svgs
1188
1183
pathsList.clear ();
0 commit comments