Skip to content

Commit

Permalink
store profiles as QStringList to avoid issues with spaces (fix #16327)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbruy committed May 16, 2017
1 parent 11475c6 commit b9bd66d
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/gui/qgsrasterformatsaveoptionswidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,6 @@ void QgsRasterFormatSaveOptionsWidget::on_mOptionsDeleteButton_clicked()
}
}


QString QgsRasterFormatSaveOptionsWidget::settingsKey( QString profileName ) const
{
if ( profileName != QLatin1String( "" ) )
Expand Down Expand Up @@ -528,16 +527,16 @@ void QgsRasterFormatSaveOptionsWidget::deleteCreateOptions( const QString &profi
void QgsRasterFormatSaveOptionsWidget::setCreateOptions()
{
QgsSettings mySettings;
QString myProfiles;
QStringList myProfiles;
QMap< QString, QString >::const_iterator i = mOptionsMap.constBegin();
while ( i != mOptionsMap.constEnd() )
{
setCreateOptions( i.key(), i.value() );
myProfiles += i.key() + QStringLiteral( " " );
myProfiles << i.key();
++i;
}
mySettings.setValue( mProvider + "/driverOptions/" + pseudoFormat().toLower() + "/profiles",
myProfiles.trimmed() );
myProfiles );
mySettings.setValue( mProvider + "/driverOptions/" + pseudoFormat().toLower() + "/defaultProfile",
currentProfileKey().trimmed() );
}
Expand All @@ -556,7 +555,7 @@ void QgsRasterFormatSaveOptionsWidget::setCreateOptions( const QString &profileN
QStringList QgsRasterFormatSaveOptionsWidget::profiles() const
{
QgsSettings mySettings;
return mySettings.value( mProvider + "/driverOptions/" + pseudoFormat().toLower() + "/profiles", "" ).toString().trimmed().split( ' ', QString::SkipEmptyParts );
return mySettings.value( mProvider + "/driverOptions/" + pseudoFormat().toLower() + "/profiles", "" ).toStringList();
}

void QgsRasterFormatSaveOptionsWidget::swapOptionsUI( int newIndex )
Expand Down

0 comments on commit b9bd66d

Please sign in to comment.