Skip to content
Permalink
Browse files

Add method to retrieve OGR supported directory driver extensions (e.g…

…. 'gdb')
  • Loading branch information
nyalldawson authored and elpaso committed Sep 18, 2017
1 parent d7029bb commit ca0fea795dd5bdf252918c4a539667c402dc3d30
Showing with 15 additions and 0 deletions.
  1. +15 −0 src/providers/ogr/qgsogrprovider.cpp
@@ -2171,6 +2171,8 @@ QString createFilters( const QString &type )
static QString sDirectoryDrivers;
//! Extensions
static QStringList sExtensions;
//! Directory extensions
static QStringList sDirectoryExtensions;
//! Wildcards
static QStringList sWildcards;

@@ -2238,6 +2240,8 @@ QString createFilters( const QString &type )
else if ( driverName.startsWith( QLatin1String( "FileGDB" ) ) )
{
sDirectoryDrivers += QObject::tr( "ESRI FileGDB" ) + ",FileGDB;";
if ( !sDirectoryExtensions.contains( QStringLiteral( "gdb" ) ) )
sDirectoryExtensions << QStringLiteral( "gdb" );
}
else if ( driverName.startsWith( QLatin1String( "PGeo" ) ) )
{
@@ -2352,6 +2356,8 @@ QString createFilters( const QString &type )
else if ( driverName.startsWith( QLatin1String( "OpenFileGDB" ) ) )
{
sDirectoryDrivers += QObject::tr( "OpenFileGDB" ) + ",OpenFileGDB;";
if ( !sDirectoryExtensions.contains( QStringLiteral( "gdb" ) ) )
sDirectoryExtensions << QStringLiteral( "gdb" );
}
else if ( driverName.startsWith( QLatin1String( "PostgreSQL" ) ) )
{
@@ -2567,6 +2573,10 @@ QString createFilters( const QString &type )
{
return sExtensions.join( QStringLiteral( "|" ) );
}
if ( type == QStringLiteral( "directory_extensions" ) )
{
return sDirectoryExtensions.join( QStringLiteral( "|" ) );
}
if ( type == QLatin1String( "wildcards" ) )
{
return sWildcards.join( QStringLiteral( "|" ) );
@@ -2623,6 +2633,11 @@ QGISEXTERN QStringList fileExtensions()
return createFilters( QStringLiteral( "extensions" ) ).split( '|' );
}

QGISEXTERN QStringList directoryExtensions()
{
return createFilters( QStringLiteral( "directory_extensions" ) ).split( '|' );
}

QGISEXTERN QStringList wildcards()
{
return createFilters( QStringLiteral( "wildcards" ) ).split( '|' );

0 comments on commit ca0fea7

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