Skip to content

Commit f442485

Browse files
committedJul 6, 2018
argumentname containerType
1 parent 774b4f6 commit f442485

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed
 

‎src/core/qgsofflineediting.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,14 @@ QgsOfflineEditing::QgsOfflineEditing()
7676
* - remove remote layers
7777
* - mark as offline project
7878
*/
79-
bool QgsOfflineEditing::convertToOfflineProject( const QString &offlineDataPath, const QString &offlineDbFile, const QStringList &layerIds, bool onlySelected, ContainerType dbContainerType )
79+
bool QgsOfflineEditing::convertToOfflineProject( const QString &offlineDataPath, const QString &offlineDbFile, const QStringList &layerIds, bool onlySelected, ContainerType containerType )
8080
{
8181
if ( layerIds.isEmpty() )
8282
{
8383
return false;
8484
}
8585
QString dbPath = QDir( offlineDataPath ).absoluteFilePath( offlineDbFile );
86-
if ( createOfflineDb( dbPath, dbContainerType ) )
86+
if ( createOfflineDb( dbPath, containerType ) )
8787
{
8888
spatialite_database_unique_ptr database;
8989
int rc = database.open( dbPath );
@@ -138,7 +138,7 @@ bool QgsOfflineEditing::convertToOfflineProject( const QString &offlineDataPath,
138138
if ( vl )
139139
{
140140
QString origLayerId = vl->id();
141-
QgsVectorLayer *newLayer = copyVectorLayer( vl, database.get(), dbPath, onlySelected, dbContainerType );
141+
QgsVectorLayer *newLayer = copyVectorLayer( vl, database.get(), dbPath, onlySelected, containerType );
142142
if ( newLayer )
143143
{
144144
layerIdMapping.insert( origLayerId, newLayer );
@@ -385,7 +385,7 @@ void QgsOfflineEditing::initializeSpatialMetadata( sqlite3 *sqlite_handle )
385385
spatial_ref_sys_init( sqlite_handle, 0 );
386386
}
387387

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

409409
// creating geopackage
410-
if ( dbContainerType == GPKG )
410+
if ( containerType == GPKG )
411411
{
412412
OGRSFDriverH hGpkgDriver = OGRGetDriverByName( "GPKG" );
413413
if ( !hGpkgDriver )
@@ -492,7 +492,7 @@ void QgsOfflineEditing::createLoggingTables( sqlite3 *db )
492492
*/
493493
}
494494

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

506-
if ( dbContainerType != GPKG )
506+
if ( containerType != GPKG )
507507
{
508508
// create table
509509
QString sql = QStringLiteral( "CREATE TABLE '%1' (" ).arg( tableName );

‎src/core/qgsofflineediting.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class CORE_EXPORT QgsOfflineEditing : public QObject
6464
* \param layerIds List of layer names to convert
6565
* \param onlySelected Only copy selected features from layers where a selection is present
6666
*/
67-
bool convertToOfflineProject( const QString &offlineDataPath, const QString &offlineDbFile, const QStringList &layerIds, bool onlySelected = false, ContainerType dbContainerType = SpatiaLite );
67+
bool convertToOfflineProject( const QString &offlineDataPath, const QString &offlineDbFile, const QStringList &layerIds, bool onlySelected = false, ContainerType containerType = SpatiaLite );
6868

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

114114
private:
115115
void initializeSpatialMetadata( sqlite3 *sqlite_handle );
116-
bool createOfflineDb( const QString &offlineDbPath, ContainerType dbContainerType = SpatiaLite );
116+
bool createOfflineDb( const QString &offlineDbPath, ContainerType containerType = SpatiaLite );
117117
void createLoggingTables( sqlite3 *db );
118118

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

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

0 commit comments

Comments
 (0)
Please sign in to comment.