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
Showing with 16 additions and 0 deletions.
  1. +8 −0 src/providers/gdal/qgsgdaldataitems.cpp
  2. +8 −0 src/providers/ogr/qgsogrdataitems.cpp
@@ -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.
You can’t perform that action at this time.