Skip to content

Commit

Permalink
Fix home dir being added as default svg and template path
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jun 30, 2016
1 parent cb9c026 commit db9a95e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
20 changes: 8 additions & 12 deletions src/app/qgsoptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}
Expand Down
4 changes: 2 additions & 2 deletions src/core/qgsapplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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( '|' );
Expand All @@ -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( '|' );
Expand Down

0 comments on commit db9a95e

Please sign in to comment.