Skip to content

Commit

Permalink
[Geometry Checker] Use a more readable file format list
Browse files Browse the repository at this point in the history
  • Loading branch information
DelazJ committed Nov 18, 2017
1 parent af6b4cc commit c2a940a
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/plugins/geometry_checker/qgsgeometrycheckersetuptab.cpp
Expand Up @@ -54,15 +54,10 @@ QgsGeometryCheckerSetupTab::QgsGeometryCheckerSetupTab( QgisInterface *iface, QD
mAbortButton = new QPushButton( tr( "Abort" ) );
mRunButton->setEnabled( false );

const auto filterFormatMap = QgsVectorFileWriter::supportedFiltersAndFormats( QgsVectorFileWriter::SortRecommended | QgsVectorFileWriter::SkipNonSpatialFormats );
for ( const QgsVectorFileWriter::FilterFormatDetails &filter : filterFormatMap )
const auto drivers = QgsVectorFileWriter::ogrDriverList( QgsVectorFileWriter::SortRecommended | QgsVectorFileWriter::SkipNonSpatialFormats );
for ( const QgsVectorFileWriter::DriverDetails &driver : drivers )
{
QString driverName = filter.driverName;
ui.comboBoxOutputFormat->addItem( driverName );
if ( driverName == QLatin1String( "ESRI Shapefile" ) )
{
ui.comboBoxOutputFormat->setCurrentIndex( ui.comboBoxOutputFormat->count() - 1 );
}
ui.comboBoxOutputFormat->addItem( driver.longName, driver.driverName );
}
ui.listWidgetInputLayers->setIconSize( QSize( 16, 16 ) );

Expand Down Expand Up @@ -297,7 +292,7 @@ void QgsGeometryCheckerSetupTab::runChecks()
{
// Get output directory and file extension
QDir outputDir = QDir( ui.lineEditOutputDirectory->text() );
QString outputDriverName = ui.comboBoxOutputFormat->currentText();
QString outputDriverName = ui.comboBoxOutputFormat->currentData().toString();
QgsVectorFileWriter::MetaData metadata;
if ( !QgsVectorFileWriter::driverMetadata( outputDriverName, metadata ) )
{
Expand Down

0 comments on commit c2a940a

Please sign in to comment.