-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* don't apply un-overridden default options * DGN: don't export attributes and fix layername to "elements" (cherry picked from commit 7634b0b)
- Loading branch information
Showing
2 changed files
with
26 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -347,7 +347,7 @@ void QgsVectorLayerSaveAsDialog::on_mFormatComboBox_currentIndexChanged( int idx | |
bool fieldsAsDisplayedValues = false; | ||
|
||
const QString sFormat( format() ); | ||
if ( sFormat == QLatin1String( "DXF" ) ) | ||
if ( sFormat == QLatin1String( "DXF" ) || sFormat == QLatin1String( "DGN" ) ) | ||
{ | ||
mAttributesSelection->setEnabled( false ); | ||
selectAllFields = false; | ||
|
@@ -686,24 +686,27 @@ QStringList QgsVectorLayerSaveAsDialog::datasourceOptions() const | |
{ | ||
case QgsVectorFileWriter::Int: | ||
{ | ||
QgsVectorFileWriter::IntOption *opt = dynamic_cast<QgsVectorFileWriter::IntOption *>( *it ); | ||
QSpinBox *sb = mDatasourceOptionsGroupBox->findChild<QSpinBox *>( it.key() ); | ||
if ( sb ) | ||
if ( opt && sb && sb->value() != opt->defaultValue ) | ||
options << QStringLiteral( "%1=%2" ).arg( it.key() ).arg( sb->value() ); | ||
break; | ||
} | ||
|
||
case QgsVectorFileWriter::Set: | ||
{ | ||
QgsVectorFileWriter::SetOption *opt = dynamic_cast<QgsVectorFileWriter::SetOption *>( *it ); | ||
QComboBox *cb = mDatasourceOptionsGroupBox->findChild<QComboBox *>( it.key() ); | ||
if ( cb && !cb->currentData().isNull() ) | ||
if ( opt && cb && cb->itemData( cb->currentIndex() ) != opt->defaultValue ) | ||
options << QStringLiteral( "%1=%2" ).arg( it.key(), cb->currentText() ); | ||
break; | ||
} | ||
|
||
case QgsVectorFileWriter::String: | ||
{ | ||
QgsVectorFileWriter::StringOption *opt = dynamic_cast<QgsVectorFileWriter::StringOption *>( *it ); | ||
QLineEdit *le = mDatasourceOptionsGroupBox->findChild<QLineEdit *>( it.key() ); | ||
if ( le ) | ||
if ( opt && le && le->text() != opt->defaultValue ) | ||
options << QStringLiteral( "%1=%2" ).arg( it.key(), le->text() ); | ||
break; | ||
} | ||
|
@@ -738,24 +741,26 @@ QStringList QgsVectorLayerSaveAsDialog::layerOptions() const | |
{ | ||
case QgsVectorFileWriter::Int: | ||
{ | ||
QgsVectorFileWriter::IntOption *opt = dynamic_cast<QgsVectorFileWriter::IntOption *>( *it ); | ||
QSpinBox *sb = mLayerOptionsGroupBox->findChild<QSpinBox *>( it.key() ); | ||
if ( sb ) | ||
options << QStringLiteral( "%1=%2" ).arg( it.key() ).arg( sb->value() ); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
nyalldawson
Collaborator
|
||
break; | ||
if ( opt && sb && sb->value() != opt->defaultValue ) | ||
break; | ||
} | ||
|
||
case QgsVectorFileWriter::Set: | ||
{ | ||
QgsVectorFileWriter::SetOption *opt = dynamic_cast<QgsVectorFileWriter::SetOption *>( *it ); | ||
QComboBox *cb = mLayerOptionsGroupBox->findChild<QComboBox *>( it.key() ); | ||
if ( cb && !cb->currentData().isNull() ) | ||
if ( opt && cb && cb->itemData( cb->currentIndex() ) != opt->defaultValue ) | ||
options << QStringLiteral( "%1=%2" ).arg( it.key(), cb->currentText() ); | ||
break; | ||
} | ||
|
||
case QgsVectorFileWriter::String: | ||
{ | ||
QgsVectorFileWriter::StringOption *opt = dynamic_cast<QgsVectorFileWriter::StringOption *>( *it ); | ||
QLineEdit *le = mLayerOptionsGroupBox->findChild<QLineEdit *>( it.key() ); | ||
if ( le && !le->text().isEmpty() ) | ||
if ( opt && le && le->text() != opt->defaultValue ) | ||
options << QStringLiteral( "%1=%2" ).arg( it.key(), le->text() ); | ||
break; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@jef-n was this line dropped accidentally?