Skip to content
Permalink
Browse files

Remove double entry for new gpkg table in browser

  • Loading branch information
elpaso committed Jul 16, 2020
1 parent b1c371a commit fe69426b12db18dd4e610b3887237bcef43716a0
Showing with 0 additions and 20 deletions.
  1. +0 −20 src/gui/providers/ogr/qgsgeopackageitemguiprovider.cpp
@@ -91,26 +91,6 @@ void QgsGeoPackageItemGuiProvider::populateContextMenu( QgsDataItem *item, QMenu
menu->addAction( actionAddConnection );
}

// Add table to existing DB
QAction *actionAddTable = new QAction( tr( "Create a New Layer or Table…" ), collectionItem->parent() );
QPointer<QgsGeoPackageCollectionItem>collectionItemPtr { collectionItem };
const QString itemPath = collectionItem->path().remove( QStringLiteral( "gpkg:/" ) );
connect( actionAddTable, &QAction::triggered, actionAddTable, [ collectionItemPtr, itemPath ]
{
QgsNewGeoPackageLayerDialog dialog( nullptr );
dialog.setDatabasePath( itemPath );
dialog.setCrs( QgsProject::instance()->defaultCrsForNewLayers() );
dialog.setOverwriteBehavior( QgsNewGeoPackageLayerDialog::AddNewLayer );
dialog.lockDatabasePath();
if ( dialog.exec() == QDialog::Accepted )
{
if ( collectionItemPtr )
collectionItemPtr->refreshConnections();
}
} );

menu->addAction( actionAddTable );

QAction *sep = new QAction( collectionItem->parent() );
sep->setSeparator( true );
menu->addAction( sep );

0 comments on commit fe69426

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