Skip to content
Permalink
Browse files

Merge pull request #8810 from signedav/vacuum-after-delete

Request for VACUUM after deleting GPKG layer
  • Loading branch information
m-kuhn committed Jan 8, 2019
2 parents dd0b33e + 1585ab4 commit 3732cb7e4019a706a8b5c3589f4ce67f495d93b9
Showing with 15 additions and 1 deletion.
  1. +15 −1 src/providers/ogr/qgsgeopackagedataitems.cpp
@@ -525,9 +525,23 @@ bool QgsGeoPackageAbstractLayerItem::deleteLayer()
}
else
{
QMessageBox::information( nullptr, tr( "Delete Layer" ), tr( "Layer <b>%1</b> deleted successfully." ).arg( mName ) );

QgsGeoPackageConnectionItem *connectionParentItem = qobject_cast<QgsGeoPackageConnectionItem *>( mParent );
if ( connectionParentItem )
{
if ( QMessageBox::question( nullptr, QObject::tr( "Delete Layer" ), QObject::tr( "The layer <b>%1</b> has been deleted successfully."
" Compact database (VACUUM) <b>%2</b> now?" ).arg( mName, connectionParentItem->name() ), QMessageBox::Yes | QMessageBox::No, QMessageBox::No ) == QMessageBox::Yes )
{
connectionParentItem->vacuumGeoPackageDbAction();
}
}
else
{
QMessageBox::information( nullptr, tr( "Delete Layer" ), tr( "The layer <b>%1</b> has been deleted successfully." ).arg( mName ) );
}
if ( mParent )
mParent->refreshConnections();

}
return true;
}

0 comments on commit 3732cb7

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