@@ -266,18 +266,13 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl )
266
266
}
267
267
268
268
// locations of the QGIS help
269
- myPaths = mSettings ->value ( QStringLiteral ( " help/helpSearchPath" ), " " ). toString ();
270
- if ( !myPaths. isEmpty () )
269
+ QStringList helpPathList = mSettings ->value ( QStringLiteral ( " help/helpSearchPath" ) ). toStringList ();
270
+ Q_FOREACH ( const QString& path, helpPathList )
271
271
{
272
- QStringList myPathList = myPaths.split ( ' |' );
273
- QStringList::const_iterator pathIt = myPathList.constBegin ();
274
- for ( ; pathIt != myPathList.constEnd (); ++pathIt )
275
- {
276
- QTreeWidgetItem* item = new QTreeWidgetItem ();
277
- item->setText ( 0 , *pathIt );
278
- item->setFlags ( Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsEditable );
279
- mHelpPathTreeWidget ->addTopLevelItem ( item );
280
- }
272
+ QTreeWidgetItem* item = new QTreeWidgetItem ();
273
+ item->setText ( 0 , path );
274
+ item->setFlags ( Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsEditable );
275
+ mHelpPathTreeWidget ->addTopLevelItem ( item );
281
276
}
282
277
283
278
// Network timeout
@@ -1112,20 +1107,15 @@ void QgsOptions::saveOptions()
1112
1107
mSettings ->setValue ( QStringLiteral ( " /browser/hiddenPaths" ), pathsList );
1113
1108
1114
1109
// QGIS help locations
1115
- myPaths. clear () ;
1110
+ QStringList helpPaths ;
1116
1111
for ( int i = 0 ; i < mHelpPathTreeWidget ->topLevelItemCount (); ++i )
1117
1112
{
1118
- QTreeWidgetItem* item = mHelpPathTreeWidget ->topLevelItem ( i );
1119
- if ( item )
1113
+ if ( QTreeWidgetItem* item = mHelpPathTreeWidget ->topLevelItem ( i ) )
1120
1114
{
1121
- if ( i != 0 )
1122
- {
1123
- myPaths += ' |' ;
1124
- }
1125
- myPaths += item->text ( 0 );
1115
+ helpPaths << item->text ( 0 );
1126
1116
}
1127
1117
}
1128
- mSettings ->setValue ( QStringLiteral ( " help/helpSearchPath" ), myPaths );
1118
+ mSettings ->setValue ( QStringLiteral ( " help/helpSearchPath" ), helpPaths );
1129
1119
1130
1120
// Network timeout
1131
1121
mSettings ->setValue ( QStringLiteral ( " /qgis/networkAndProxy/networkTimeout" ), mNetworkTimeoutSpinBox ->value () );
@@ -1747,7 +1737,7 @@ void QgsOptions::on_mBtnRemovePluginPath_clicked()
1747
1737
void QgsOptions::on_mBtnAddHelpPath_clicked ()
1748
1738
{
1749
1739
QTreeWidgetItem* item = new QTreeWidgetItem ();
1750
- item->setText ( 0 , QLatin1String ( " " ) );
1740
+ item->setText ( 0 , QString ( ) );
1751
1741
item->setFlags ( Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsEditable );
1752
1742
mHelpPathTreeWidget ->addTopLevelItem ( item );
1753
1743
}
0 commit comments