Skip to content
Permalink
Browse files

argumentname containerType

  • Loading branch information
signedav committed Jul 6, 2018
1 parent 774b4f6 commit f4424853f7c57aee6382c7433dccc00c80d58e9d
Showing with 10 additions and 10 deletions.
  1. +7 −7 src/core/qgsofflineediting.cpp
  2. +3 −3 src/core/qgsofflineediting.h
@@ -76,14 +76,14 @@ QgsOfflineEditing::QgsOfflineEditing()
* - remove remote layers
* - mark as offline project
*/
bool QgsOfflineEditing::convertToOfflineProject( const QString &offlineDataPath, const QString &offlineDbFile, const QStringList &layerIds, bool onlySelected, ContainerType dbContainerType )
bool QgsOfflineEditing::convertToOfflineProject( const QString &offlineDataPath, const QString &offlineDbFile, const QStringList &layerIds, bool onlySelected, ContainerType containerType )
{
if ( layerIds.isEmpty() )
{
return false;
}
QString dbPath = QDir( offlineDataPath ).absoluteFilePath( offlineDbFile );
if ( createOfflineDb( dbPath, dbContainerType ) )
if ( createOfflineDb( dbPath, containerType ) )
{
spatialite_database_unique_ptr database;
int rc = database.open( dbPath );
@@ -138,7 +138,7 @@ bool QgsOfflineEditing::convertToOfflineProject( const QString &offlineDataPath,
if ( vl )
{
QString origLayerId = vl->id();
QgsVectorLayer *newLayer = copyVectorLayer( vl, database.get(), dbPath, onlySelected, dbContainerType );
QgsVectorLayer *newLayer = copyVectorLayer( vl, database.get(), dbPath, onlySelected, containerType );
if ( newLayer )
{
layerIdMapping.insert( origLayerId, newLayer );
@@ -385,7 +385,7 @@ void QgsOfflineEditing::initializeSpatialMetadata( sqlite3 *sqlite_handle )
spatial_ref_sys_init( sqlite_handle, 0 );
}

bool QgsOfflineEditing::createOfflineDb( const QString &offlineDbPath, ContainerType dbContainerType )
bool QgsOfflineEditing::createOfflineDb( const QString &offlineDbPath, ContainerType containerType )
{
int ret;
char *errMsg = nullptr;
@@ -407,7 +407,7 @@ bool QgsOfflineEditing::createOfflineDb( const QString &offlineDbPath, Container
QString dbPath = newDb.fileName();

// creating geopackage
if ( dbContainerType == GPKG )
if ( containerType == GPKG )
{
OGRSFDriverH hGpkgDriver = OGRGetDriverByName( "GPKG" );
if ( !hGpkgDriver )
@@ -492,7 +492,7 @@ void QgsOfflineEditing::createLoggingTables( sqlite3 *db )
*/
}

QgsVectorLayer *QgsOfflineEditing::copyVectorLayer( QgsVectorLayer *layer, sqlite3 *db, const QString &offlineDbPath, bool onlySelected, ContainerType dbContainerType )
QgsVectorLayer *QgsOfflineEditing::copyVectorLayer( QgsVectorLayer *layer, sqlite3 *db, const QString &offlineDbPath, bool onlySelected, ContainerType containerType )
{
if ( !layer )
return nullptr;
@@ -503,7 +503,7 @@ QgsVectorLayer *QgsOfflineEditing::copyVectorLayer( QgsVectorLayer *layer, sqlit
// new layer
QgsVectorLayer *newLayer = nullptr;

if ( dbContainerType != GPKG )
if ( containerType != GPKG )
{
// create table
QString sql = QStringLiteral( "CREATE TABLE '%1' (" ).arg( tableName );
@@ -64,7 +64,7 @@ class CORE_EXPORT QgsOfflineEditing : public QObject
* \param layerIds List of layer names to convert
* \param onlySelected Only copy selected features from layers where a selection is present
*/
bool convertToOfflineProject( const QString &offlineDataPath, const QString &offlineDbFile, const QStringList &layerIds, bool onlySelected = false, ContainerType dbContainerType = SpatiaLite );
bool convertToOfflineProject( const QString &offlineDataPath, const QString &offlineDbFile, const QStringList &layerIds, bool onlySelected = false, ContainerType containerType = SpatiaLite );

//! Returns true if current project is offline
bool isOfflineProject() const;
@@ -113,10 +113,10 @@ class CORE_EXPORT QgsOfflineEditing : public QObject

private:
void initializeSpatialMetadata( sqlite3 *sqlite_handle );
bool createOfflineDb( const QString &offlineDbPath, ContainerType dbContainerType = SpatiaLite );
bool createOfflineDb( const QString &offlineDbPath, ContainerType containerType = SpatiaLite );
void createLoggingTables( sqlite3 *db );

QgsVectorLayer *copyVectorLayer( QgsVectorLayer *layer, sqlite3 *db, const QString &offlineDbPath, bool onlySelected, ContainerType dbContainerType = SpatiaLite );
QgsVectorLayer *copyVectorLayer( QgsVectorLayer *layer, sqlite3 *db, const QString &offlineDbPath, bool onlySelected, ContainerType containerType = SpatiaLite );

void applyAttributesAdded( QgsVectorLayer *remoteLayer, sqlite3 *db, int layerId, int commitNo );
void applyFeaturesAdded( QgsVectorLayer *offlineLayer, QgsVectorLayer *remoteLayer, sqlite3 *db, int layerId );

0 comments on commit f442485

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