Skip to content
Permalink
Browse files

Use more appropriate refresh action after changing gpkg through browser

Avoids the geopackage state collapsing each time, and ensures that
the contents are correctly refreshed for non-registered geopackage
files
  • Loading branch information
nyalldawson committed Nov 21, 2020
1 parent c7aa09b commit 2c38169354fd9df8ecf9b23cf466429848403c0a
Showing with 6 additions and 5 deletions.
  1. +6 −5 src/gui/providers/ogr/qgsgeopackageitemguiprovider.cpp
@@ -272,7 +272,7 @@ bool QgsGeoPackageItemGuiProvider::rename( QgsDataItem *item, const QString &new
}
else if ( layerItem->parent() )
{
layerItem->parent()->refreshConnections();
layerItem->parent()->refresh();
}

return errCause.isEmpty();
@@ -358,8 +358,9 @@ bool QgsGeoPackageItemGuiProvider::deleteLayer( QgsLayerItem *layerItem, QgsData
QMessageBox::information( nullptr, tr( "Delete Layer" ), tr( "The layer <b>%1</b> was successfully deleted." ).arg( item->name() ) );
}
if ( item->parent() )
item->parent()->refreshConnections();

{
item->parent()->refresh();
}
}
return true;
}
@@ -530,7 +531,7 @@ bool QgsGeoPackageItemGuiProvider::handleDropGeopackage( QgsGeoPackageCollection
context.messageBar()->pushMessage( tr( "Import to GeoPackage database" ), tr( "Import was successful." ), Qgis::Success );
else
QMessageBox::information( nullptr, tr( "Import to GeoPackage database" ), tr( "Import was successful." ) );
item->refreshConnections();
item->refresh();
} );

// when an error occurs:
@@ -558,7 +559,7 @@ bool QgsGeoPackageItemGuiProvider::handleDropGeopackage( QgsGeoPackageCollection
context.messageBar()->pushMessage( tr( "Import to GeoPackage database" ), tr( "Import was successful." ), Qgis::Success );
else
QMessageBox::information( nullptr, tr( "Import to GeoPackage database" ), tr( "Import was successful." ) );
item->refreshConnections();
item->refresh();
} );

// when an error occurs:

0 comments on commit 2c38169

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