Skip to content
Permalink
Browse files

Fix home dir being added as default svg and template path

  • Loading branch information
nyalldawson committed Jun 8, 2016
1 parent f0c8fe6 commit 50cada431c37ebd0f230ce9cee4ceeca7334dc59
Showing with 10 additions and 14 deletions.
  1. +8 −12 src/app/qgsoptions.cpp
  2. +2 −2 src/core/qgsapplication.cpp
@@ -235,29 +235,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 );
}
@@ -706,7 +706,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( '|' );
@@ -725,7 +725,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 50cada4

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