Skip to content
Permalink
Browse files
store profiles as QStringList to avoid issues with spaces (fix #16327)
  • Loading branch information
alexbruy committed May 16, 2017
1 parent 11475c6 commit b9bd66d2b35c5550a955f148c3242cac0801d81d
Showing with 4 additions and 5 deletions.
  1. +4 −5 src/gui/qgsrasterformatsaveoptionswidget.cpp
@@ -493,7 +493,6 @@ void QgsRasterFormatSaveOptionsWidget::on_mOptionsDeleteButton_clicked()
}
}


QString QgsRasterFormatSaveOptionsWidget::settingsKey( QString profileName ) const
{
if ( profileName != QLatin1String( "" ) )
@@ -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() );
}
@@ -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 )

0 comments on commit b9bd66d

Please sign in to comment.