File tree Expand file tree Collapse file tree 1 file changed +23
-3
lines changed
Expand file tree Collapse file tree 1 file changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -228,8 +228,6 @@ void QgsVectorLayerSaveAsDialog::on_mFormatComboBox_currentIndexChanged( int idx
228228
229229 if ( format () == " KML" )
230230 {
231- mEncodingComboBox ->setCurrentIndex ( mEncodingComboBox ->findText ( " UTF-8" ) );
232- mEncodingComboBox ->setDisabled ( true );
233231 mAttributesSelection ->setEnabled ( true );
234232 selectAllFields = false ;
235233 }
@@ -240,7 +238,6 @@ void QgsVectorLayerSaveAsDialog::on_mFormatComboBox_currentIndexChanged( int idx
240238 }
241239 else
242240 {
243- mEncodingComboBox ->setEnabled ( true );
244241 mAttributesSelection ->setEnabled ( true );
245242 fieldsAsDisplayedValues = ( format () == " CSV" || format () == " XLS" || format () == " XLSX" || format () == " ODS" );
246243 }
@@ -372,6 +369,29 @@ void QgsVectorLayerSaveAsDialog::on_mFormatComboBox_currentIndexChanged( int idx
372369 {
373370 mLayerOptionsGroupBox ->setVisible ( false );
374371 }
372+
373+ if ( driverMetaData.compulsoryEncoding .isEmpty () )
374+ {
375+ mEncodingComboBox ->setEnabled ( true );
376+ }
377+ else
378+ {
379+ int idx = mEncodingComboBox ->findText ( driverMetaData.compulsoryEncoding );
380+ if ( idx >= 0 )
381+ {
382+ mEncodingComboBox ->setCurrentIndex ( idx );
383+ mEncodingComboBox ->setDisabled ( true );
384+ }
385+ else
386+ {
387+ mEncodingComboBox ->setEnabled ( true );
388+ }
389+ }
390+
391+ }
392+ else
393+ {
394+ mEncodingComboBox ->setEnabled ( true );
375395 }
376396}
377397
You can’t perform that action at this time.
0 commit comments