Skip to content

Commit fc51b82

Browse files
DelazJnirvn
authored andcommitted
[save as vector] use the save/restore geomtry API
1 parent ea40f1e commit fc51b82

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/gui/ogr/qgsvectorlayersaveasdialog.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ QgsVectorLayerSaveAsDialog::QgsVectorLayerSaveAsDialog( QgsVectorLayer *layer, i
7373
void QgsVectorLayerSaveAsDialog::setup()
7474
{
7575
setupUi( this );
76+
QgsGui::instance()->enableAutoGeometryRestore( this );
77+
7678
connect( mFormatComboBox, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, &QgsVectorLayerSaveAsDialog::mFormatComboBox_currentIndexChanged );
7779
connect( mCrsSelector, &QgsProjectionSelectionWidget::crsChanged, this, &QgsVectorLayerSaveAsDialog::mCrsSelector_crsChanged );
7880
connect( mSymbologyExportComboBox, static_cast<void ( QComboBox::* )( const QString & )>( &QComboBox::currentIndexChanged ), this, &QgsVectorLayerSaveAsDialog::mSymbologyExportComboBox_currentIndexChanged );
@@ -83,16 +85,14 @@ void QgsVectorLayerSaveAsDialog::setup()
8385
connect( mAttributeTable, &QTableWidget::itemChanged, this, &QgsVectorLayerSaveAsDialog::mAttributeTable_itemChanged );
8486
connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsVectorLayerSaveAsDialog::showHelp );
8587

86-
QgsSettings settings;
87-
restoreGeometry( settings.value( QStringLiteral( "Windows/VectorLayerSaveAs/geometry" ) ).toByteArray() );
88-
8988
const QList< QgsVectorFileWriter::DriverDetails > drivers = QgsVectorFileWriter::ogrDriverList();
9089
mFormatComboBox->blockSignals( true );
9190
for ( const QgsVectorFileWriter::DriverDetails &driver : drivers )
9291
{
9392
mFormatComboBox->addItem( driver.longName, driver.driverName );
9493
}
9594

95+
QgsSettings settings;
9696
QString format = settings.value( QStringLiteral( "UI/lastVectorFormat" ), "GPKG" ).toString();
9797
mFormatComboBox->setCurrentIndex( mFormatComboBox->findData( format ) );
9898
mFormatComboBox->blockSignals( false );
@@ -153,8 +153,7 @@ void QgsVectorLayerSaveAsDialog::setup()
153153
QFileInfo fileInfo( filePath );
154154
leLayername->setText( fileInfo.baseName() );
155155
}
156-
buttonBox->button( QDialogButtonBox::Ok )->setEnabled(
157-
!filePath.isEmpty() && QFileInfo( filePath ).absoluteDir().exists() );
156+
buttonBox->button( QDialogButtonBox::Ok )->setEnabled( !filePath.isEmpty() );
158157
} );
159158
}
160159

@@ -237,8 +236,6 @@ QList<QPair<QLabel *, QWidget *> > QgsVectorLayerSaveAsDialog::createControls( c
237236

238237
QgsVectorLayerSaveAsDialog::~QgsVectorLayerSaveAsDialog()
239238
{
240-
QgsSettings settings;
241-
settings.setValue( QStringLiteral( "Windows/VectorLayerSaveAs/geometry" ), saveGeometry() );
242239
}
243240

244241
void QgsVectorLayerSaveAsDialog::accept()

0 commit comments

Comments
 (0)