Skip to content
Permalink
Browse files

skip malformed key-values pairs

add options example in docs
  • Loading branch information
alexbruy committed Jan 7, 2017
1 parent d718eb0 commit 85d40937b962062be977502ab5bf91d90ea7123e
@@ -50,7 +50,8 @@ class QgsRasterFormatSaveOptionsWidget : QWidget
QStringList options() const;

/**
* Populate widget with user-defined options
* Populate widget with user-defined options. String should contain
* key=value pairs separated by spaces, e.g. "TILED=YES TFW=YES"
* @see options()
* @note added in QGIS 3.0
*/
@@ -644,10 +644,13 @@ void QgsRasterFormatSaveOptionsWidget::setOptions( const QString& options )
mOptionsTable->insertRow( rowCount );

values = opt.split( '=' );
QTableWidgetItem* nameItem = new QTableWidgetItem( values.at( 0 ) );
mOptionsTable->setItem( rowCount, 0, nameItem );
QTableWidgetItem* valueItem = new QTableWidgetItem( values.at( 1 ) );
mOptionsTable->setItem( rowCount, 0, valueItem );
if ( values.count() == 2 )
{
QTableWidgetItem* nameItem = new QTableWidgetItem( values.at( 0 ) );
mOptionsTable->setItem( rowCount, 0, nameItem );
QTableWidgetItem* valueItem = new QTableWidgetItem( values.at( 1 ) );
mOptionsTable->setItem( rowCount, 0, valueItem );
}
}

mOptionsMap[ currentProfileKey()] = options.trimmed();
@@ -76,7 +76,8 @@ class GUI_EXPORT QgsRasterFormatSaveOptionsWidget: public QWidget,
QStringList options() const;

/**
* Populate widget with user-defined options
* Populate widget with user-defined options. String should contain
* key=value pairs separated by spaces, e.g. "TILED=YES TFW=YES"
* @see options()
* @note added in QGIS 3.0
*/

0 comments on commit 85d4093

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