Skip to content

Commit

Permalink
Merge pull request #8810 from signedav/vacuum-after-delete
Browse files Browse the repository at this point in the history
Request for VACUUM after deleting GPKG layer
  • Loading branch information
m-kuhn committed Jan 8, 2019
2 parents dd0b33e + 1585ab4 commit 3732cb7
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/providers/ogr/qgsgeopackagedataitems.cpp
Expand Up @@ -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;
}
Expand Down

0 comments on commit 3732cb7

Please sign in to comment.