Skip to content
Permalink
Browse files

If no point cloud providers are available, don't show 'point cloud' o…

…ption in data source manager
  • Loading branch information
nyalldawson committed Nov 6, 2020
1 parent fd9abf8 commit d506caf6c58361f3e4609f145f68f48e275a2c53
Showing with 12 additions and 5 deletions.
  1. +6 −3 src/core/qgsproviderregistry.cpp
  2. +6 −2 src/gui/qgsproviderguiregistry.cpp
@@ -324,9 +324,12 @@ void QgsProviderRegistry::init()
meta->initProvider();
}

pointCloudFilters.insert( 0, QObject::tr( "All Supported Files" ) + QStringLiteral( " (%1)" ).arg( pointCloudWildcards.join( ' ' ) ) );
pointCloudFilters.insert( 1, QObject::tr( "All Files" ) + QStringLiteral( " (*.*)" ) );
mPointCloudFileFilters = pointCloudFilters.join( QStringLiteral( ";;" ) );
if ( !pointCloudFilters.empty() )
{
pointCloudFilters.insert( 0, QObject::tr( "All Supported Files" ) + QStringLiteral( " (%1)" ).arg( pointCloudWildcards.join( ' ' ) ) );
pointCloudFilters.insert( 1, QObject::tr( "All Files" ) + QStringLiteral( " (*.*)" ) );
mPointCloudFileFilters = pointCloudFilters.join( QStringLiteral( ";;" ) );
}

// load database drivers (only OGR)
mDatabaseDrivers = QgsOgrProviderUtils::databaseDrivers();
@@ -80,8 +80,12 @@ void QgsProviderGuiRegistry::loadStaticProviders( )
mProviders[ ept->key() ] = ept;
#endif

QgsProviderGuiMetadata *pointcloud = new QgsPointCloudProviderGuiMetadata();
mProviders[ pointcloud->key() ] = pointcloud;
// only show point cloud option if we have at least one point cloud provider available!
if ( !QgsProviderRegistry::instance()->filePointCloudFilters().isEmpty() )
{
QgsProviderGuiMetadata *pointcloud = new QgsPointCloudProviderGuiMetadata();
mProviders[ pointcloud->key() ] = pointcloud;
}

#ifdef HAVE_STATIC_PROVIDERS
QgsProviderGuiMetadata *wms = new QgsWmsProviderGuiMetadata();

0 comments on commit d506caf

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