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