@@ -235,29 +235,25 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl )
235
235
}
236
236
237
237
// local directories to search when looking for an SVG with a given basename
238
- myPaths = mSettings -> value ( " svg/searchPathsForSVG " , QDir::homePath () ). toString ();
239
- if ( !myPaths .isEmpty () )
238
+ QStringList svgPaths = QgsApplication::svgPaths ();
239
+ if ( !svgPaths .isEmpty () )
240
240
{
241
- QStringList myPathList = myPaths.split ( ' |' );
242
- QStringList::const_iterator pathIt = myPathList.constBegin ();
243
- for ( ; pathIt != myPathList.constEnd (); ++pathIt )
241
+ Q_FOREACH ( const QString& path, svgPaths )
244
242
{
245
243
QListWidgetItem* newItem = new QListWidgetItem ( mListSVGPaths );
246
- newItem->setText ( *pathIt );
244
+ newItem->setText ( path );
247
245
newItem->setFlags ( Qt::ItemIsEditable | Qt::ItemIsEnabled | Qt::ItemIsSelectable );
248
246
mListSVGPaths ->addItem ( newItem );
249
247
}
250
248
}
251
249
252
- myPaths = mSettings -> value ( " composer/searchPathsForTemplates " , " " ). toString ();
253
- if ( !myPaths .isEmpty () )
250
+ QStringList templatePaths = QgsApplication::composerTemplatePaths ();
251
+ if ( !templatePaths .isEmpty () )
254
252
{
255
- QStringList myPathList = myPaths.split ( ' |' );
256
- QStringList::const_iterator pathIt = myPathList.constBegin ();
257
- for ( ; pathIt != myPathList.constEnd (); ++pathIt )
253
+ Q_FOREACH ( const QString& path, templatePaths )
258
254
{
259
255
QListWidgetItem* newItem = new QListWidgetItem ( mListComposerTemplatePaths );
260
- newItem->setText ( *pathIt );
256
+ newItem->setText ( path );
261
257
newItem->setFlags ( Qt::ItemIsEditable | Qt::ItemIsEnabled | Qt::ItemIsSelectable );
262
258
mListComposerTemplatePaths ->addItem ( newItem );
263
259
}
0 commit comments