mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-27 00:33:48 -05:00
QgsVectorFilewriter skip default null options
Don't specify dataset options which have null default values. Setting these as empty strings might introduce a different behavior than expected. For example not creating an xsd companion file for GML.
This commit is contained in:
parent
3b839ceb43
commit
93bc31d033
@ -1032,7 +1032,7 @@ QMap<QString, QgsVectorFileWriter::MetaData> QgsVectorFileWriter::initMetaData()
|
|||||||
"Note that the schema file isn't actually accessed by OGR, so it "
|
"Note that the schema file isn't actually accessed by OGR, so it "
|
||||||
"is up to the user to ensure it will match the schema of the OGR "
|
"is up to the user to ensure it will match the schema of the OGR "
|
||||||
"produced GML data file." ),
|
"produced GML data file." ),
|
||||||
QLatin1String( "" ) // Default value
|
QString() // Default value
|
||||||
) );
|
) );
|
||||||
|
|
||||||
datasetOptions.insert( QStringLiteral( "XSISCHEMA" ), new SetOption(
|
datasetOptions.insert( QStringLiteral( "XSISCHEMA" ), new SetOption(
|
||||||
@ -3225,7 +3225,7 @@ QStringList QgsVectorFileWriter::concatenateOptions( const QMap<QString, QgsVect
|
|||||||
case QgsVectorFileWriter::String:
|
case QgsVectorFileWriter::String:
|
||||||
{
|
{
|
||||||
QgsVectorFileWriter::StringOption *opt = dynamic_cast<QgsVectorFileWriter::StringOption *>( option );
|
QgsVectorFileWriter::StringOption *opt = dynamic_cast<QgsVectorFileWriter::StringOption *>( option );
|
||||||
if ( opt )
|
if ( opt && !opt->defaultValue.isNull() )
|
||||||
{
|
{
|
||||||
list.append( QStringLiteral( "%1=%2" ).arg( it.key(), opt->defaultValue ) );
|
list.append( QStringLiteral( "%1=%2" ).arg( it.key(), opt->defaultValue ) );
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user