Skip to content
Permalink
Browse files
GDALDataItems / OGRDataItems: avoid listing .map and .dat files of a …
….tab
  • Loading branch information
rouault committed Nov 12, 2017
1 parent 8cefb45 commit 96ec6645940dfe90bea53af9177f6a655be4dd71
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
@@ -171,6 +171,14 @@ QGISEXTERN QgsDataItem *dataItem( QString path, QgsDataItem *parentItem )
info.setFile( path );
QString name = info.fileName();

// If a .tab exists, then the corresponding .map/.dat is very likely a
// side-car file of the .tab
if ( suffix == QLatin1String( "map" ) || suffix == QLatin1String( "dat" ) )
{
if ( QFileInfo( QDir( info.path() ), info.baseName() + ".tab" ).exists() )
return nullptr;
}

QgsDebugMsgLevel( "path= " + path + " tmpPath= " + tmpPath + " name= " + name
+ " suffix= " + suffix + " vsiPrefix= " + vsiPrefix, 3 );

@@ -517,6 +517,14 @@ QGISEXTERN QgsDataItem *dataItem( QString path, QgsDataItem *parentItem )
info.setFile( path );
QString name = info.fileName();

// If a .tab exists, then the corresponding .map/.dat is very likely a
// side-car file of the .tab
if ( suffix == QLatin1String( "map" ) || suffix == QLatin1String( "dat" ) )
{
if ( QFileInfo( QDir( info.path() ), info.baseName() + ".tab" ).exists() )
return nullptr;
}

QgsDebugMsgLevel( "thePath= " + path + " tmpPath= " + tmpPath + " name= " + name
+ " suffix= " + suffix + " vsiPrefix= " + vsiPrefix, 3 );

0 comments on commit 96ec664

Please sign in to comment.