Skip to content
Permalink
Browse files

Remove redundant '[OGR'] string from dialogs

  • Loading branch information
nyalldawson committed Nov 5, 2017
1 parent dc341d2 commit d855f7f3f468543ea72e67c3215baa4da7de530b
Showing with 6 additions and 4 deletions.
  1. +4 −2 src/core/qgsvectorfilewriter.cpp
  2. +2 −2 tests/src/python/test_qgsvectorfilewriter.py
@@ -2894,9 +2894,11 @@ QString QgsVectorFileWriter::filterForDriver( const QString &driverName )
{
MetaData metadata;
if ( !driverMetadata( driverName, metadata ) || metadata.trLongName.isEmpty() || metadata.glob.isEmpty() )
return QLatin1String( "" );
return QString();

return metadata.trLongName + " [OGR] (" + metadata.glob.toLower() + ' ' + metadata.glob.toUpper() + ')';
return QStringLiteral( "%1 (%2 %3)" ).arg( metadata.trLongName,
metadata.glob.toLower(),
metadata.glob.toUpper() );
}

QString QgsVectorFileWriter::convertCodecNameForEncodingOption( const QString &codecName )
@@ -726,8 +726,8 @@ def testOverwriteLayer(self):
def testSupportedFiltersAndFormat(self):
# test with formats in recommended order
formats = QgsVectorFileWriter.supportedFiltersAndFormats(QgsVectorFileWriter.SortRecommended)
self.assertEqual(formats[0], ('GeoPackage [OGR] (*.gpkg *.GPKG)', 'GPKG'))
self.assertEqual(formats[1], ('ESRI Shapefile [OGR] (*.shp *.SHP)', 'ESRI Shapefile'))
self.assertEqual(formats[0], ('GeoPackage (*.gpkg *.GPKG)', 'GPKG'))
self.assertEqual(formats[1], ('ESRI Shapefile (*.shp *.SHP)', 'ESRI Shapefile'))
# alphabetical sorting
formats2 = QgsVectorFileWriter.supportedFiltersAndFormats(QgsVectorFileWriter.VectorFormatOptions())
self.assertTrue(formats2[0][0] < formats2[1][0])

0 comments on commit d855f7f

Please sign in to comment.
You can’t perform that action at this time.