mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-01 00:46:20 -05:00
Geopackage try to remove optional entries + fix build warnings
This commit is contained in:
parent
bcd495c693
commit
0eb302d5e8
@ -595,6 +595,24 @@ bool QgsGeoPackageRasterLayerItem::executeDeleteLayer( QString &errCause )
|
||||
&errmsg /* Error msg written here */
|
||||
);
|
||||
sqlite3_free( sql );
|
||||
// Remove from optional tables, may silently fail
|
||||
for ( const auto tableName : QStringList()
|
||||
<< QStringLiteral( "gpkg_extensions" )
|
||||
<< QStringLiteral( "gpkg_metadata" )
|
||||
<< QStringLiteral( "gpkg_metadata_reference" ) )
|
||||
{
|
||||
char *sql = sqlite3_mprintf( "DELETE FROM table %w WHERE table_name = '%q",
|
||||
tableName.toUtf8().constData(),
|
||||
layerName.toUtf8().constData() );
|
||||
status = sqlite3_exec(
|
||||
handle, /* An open database */
|
||||
sql, /* SQL to be evaluated */
|
||||
NULL, /* Callback function */
|
||||
NULL, /* 1st argument to callback */
|
||||
NULL /* Error msg written here */
|
||||
);
|
||||
sqlite3_free( sql );
|
||||
}
|
||||
if ( status == SQLITE_OK )
|
||||
{
|
||||
result = true;
|
||||
|
@ -76,7 +76,7 @@ class QgsGeoPackageConnectionItem : public QgsDataCollectionItem
|
||||
#ifdef HAVE_GUI
|
||||
virtual bool acceptDrop() override { return true; }
|
||||
virtual bool handleDrop( const QMimeData *data, Qt::DropAction action ) override;
|
||||
QList<QAction *> actions();
|
||||
QList<QAction *> actions() override;
|
||||
#endif
|
||||
|
||||
//! Return the layer type from \a geometryType
|
||||
@ -106,7 +106,7 @@ class QgsGeoPackageRootItem : public QgsDataCollectionItem
|
||||
|
||||
#ifdef HAVE_GUI
|
||||
virtual QWidget *paramWidget() override;
|
||||
QList<QAction *> actions();
|
||||
QList<QAction *> actions() override;
|
||||
|
||||
public slots:
|
||||
void newConnection();
|
||||
|
Loading…
x
Reference in New Issue
Block a user