Skip to content
Permalink
Browse files

Geopackage try to remove optional entries + fix build warnings

  • Loading branch information
elpaso committed Aug 17, 2017
1 parent bcd495c commit 0eb302d5e873d21e778630abe93e028e0d960fa6
Showing with 20 additions and 2 deletions.
  1. +18 −0 src/providers/ogr/qgsgeopackagedataitems.cpp
  2. +2 −2 src/providers/ogr/qgsgeopackagedataitems.h
@@ -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();

0 comments on commit 0eb302d

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