Skip to content
Permalink
Browse files

Fix home dir being added as default svg and template path

  • Loading branch information
nyalldawson committed Jun 30, 2016
1 parent cb9c026 commit db9a95e5ae50d383dbce2882820bb53763d3fcad
Showing with 10 additions and 14 deletions.
  1. +8 −12 src/app/qgsoptions.cpp
  2. +2 −2 src/core/qgsapplication.cpp
@@ -232,29 +232,25 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl ) :
}

//local directories to search when looking for an SVG with a given basename
myPaths = mSettings->value( "svg/searchPathsForSVG", QDir::homePath() ).toString();
if ( !myPaths.isEmpty() )
QStringList svgPaths = QgsApplication::svgPaths();
if ( !svgPaths.isEmpty() )
{
QStringList myPathList = myPaths.split( '|' );
QStringList::const_iterator pathIt = myPathList.constBegin();
for ( ; pathIt != myPathList.constEnd(); ++pathIt )
Q_FOREACH ( const QString& path, svgPaths )
{
QListWidgetItem* newItem = new QListWidgetItem( mListSVGPaths );
newItem->setText( *pathIt );
newItem->setText( path );
newItem->setFlags( Qt::ItemIsEditable | Qt::ItemIsEnabled | Qt::ItemIsSelectable );
mListSVGPaths->addItem( newItem );
}
}

myPaths = mSettings->value( "composer/searchPathsForTemplates", "" ).toString();
if ( !myPaths.isEmpty() )
QStringList templatePaths = QgsApplication::composerTemplatePaths();
if ( !templatePaths.isEmpty() )
{
QStringList myPathList = myPaths.split( '|' );
QStringList::const_iterator pathIt = myPathList.constBegin();
for ( ; pathIt != myPathList.constEnd(); ++pathIt )
Q_FOREACH ( const QString& path, templatePaths )
{
QListWidgetItem* newItem = new QListWidgetItem( mListComposerTemplatePaths );
newItem->setText( *pathIt );
newItem->setText( path );
newItem->setFlags( Qt::ItemIsEditable | Qt::ItemIsEnabled | Qt::ItemIsSelectable );
mListComposerTemplatePaths->addItem( newItem );
}
@@ -696,7 +696,7 @@ QStringList QgsApplication::svgPaths()
//defined by user in options dialog
QSettings settings;
QStringList myPathList;
QString myPaths = settings.value( "svg/searchPathsForSVG", QDir::homePath() ).toString();
QString myPaths = settings.value( "svg/searchPathsForSVG", QString() ).toString();
if ( !myPaths.isEmpty() )
{
myPathList = myPaths.split( '|' );
@@ -715,7 +715,7 @@ QStringList QgsApplication::composerTemplatePaths()
//defined by user in options dialog
QSettings settings;
QStringList myPathList;
QString myPaths = settings.value( "composer/searchPathsForTemplates", QDir::homePath() ).toString();
QString myPaths = settings.value( "composer/searchPathsForTemplates", QString() ).toString();
if ( !myPaths.isEmpty() )
{
myPathList = myPaths.split( '|' );

0 comments on commit db9a95e

Please sign in to comment.
You can’t perform that action at this time.