Skip to content

Commit

Permalink
Use more appropriate refresh action after changing gpkg through browser
Browse files Browse the repository at this point in the history
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 2c38169
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/gui/providers/ogr/qgsgeopackageitemguiprovider.cpp
Expand Up @@ -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();
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 2c38169

Please sign in to comment.