Skip to content
Permalink
Browse files

Added a comment

  • Loading branch information
elpaso committed Jul 18, 2020
1 parent 2b3c680 commit 850826cc9b978eda7a360ec38ebbc5656969ac67
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/app/browser/qgsinbuiltdataitemproviders.cpp
@@ -838,7 +838,8 @@ void QgsDatabaseItemGuiProvider::populateContextMenu( QgsDataItem *item, QMenu *
QgsProviderMetadata *md { QgsProviderRegistry::instance()->providerMetadata( dataProviderKey ) };
if ( md )
{
const bool isSchema { qobject_cast<QgsDatabaseSchemaItem *>( item ) };
// Note: we could have used layerCollection() but casting to QgsDatabaseSchemaItem is more explicit
const bool isSchema { qobject_cast<QgsDatabaseSchemaItem *>( item ) != nullptr };
const QString connectionName { isSchema ? collectionItem->parent()->name() : collectionItem->name() };
std::unique_ptr<QgsAbstractDatabaseProviderConnection> conn( static_cast<QgsAbstractDatabaseProviderConnection *>( md->createConnection( connectionName ) ) );
if ( conn && conn->capabilities().testFlag( QgsAbstractDatabaseProviderConnection::Capability::CreateVectorTable ) )

0 comments on commit 850826c

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