Skip to content

Commit 88bbe38

Browse files
committedJun 22, 2014
new vector layer: limit attribute name length of shape files to 10 (fixes #9753)
1 parent c8375f5 commit 88bbe38

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed
 

‎src/gui/qgsnewvectorlayerdialog.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ QgsNewVectorLayerDialog::QgsNewVectorLayerDialog( QWidget *parent, Qt::WindowFla
6464
mFileFormatLabel->setVisible( false );
6565
}
6666

67+
mFileFormatComboBox->setCurrentIndex( 0 );
68+
6769
mFileEncoding->addItems( QgsVectorDataProvider::availableEncodings() );
6870

6971
// Use default encoding if none supplied
@@ -104,6 +106,14 @@ QgsNewVectorLayerDialog::~QgsNewVectorLayerDialog()
104106
settings.setValue( "/Windows/NewVectorLayer/geometry", saveGeometry() );
105107
}
106108

109+
void QgsNewVectorLayerDialog::on_mFileFormatComboBox_currentIndexChanged( int index )
110+
{
111+
if ( mFileFormatComboBox->currentText() == tr( "ESRI Shapefile" ) )
112+
mNameEdit->setMaxLength( 10 );
113+
else
114+
mNameEdit->setMaxLength( 32767 );
115+
}
116+
107117
void QgsNewVectorLayerDialog::on_mTypeBox_currentIndexChanged( int index )
108118
{
109119
// FIXME: sync with providers/ogr/qgsogrprovider.cpp

‎src/gui/qgsnewvectorlayerdialog.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ class GUI_EXPORT QgsNewVectorLayerDialog: public QDialog, private Ui::QgsNewVect
4949
protected slots:
5050
void on_mAddAttributeButton_clicked();
5151
void on_mRemoveAttributeButton_clicked();
52+
void on_mFileFormatComboBox_currentIndexChanged( int index );
5253
void on_mTypeBox_currentIndexChanged( int index );
5354
void on_pbnChangeSpatialRefSys_clicked();
5455
void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }

0 commit comments

Comments
 (0)
Please sign in to comment.