@@ -87,19 +87,19 @@ QgsSpatiaLiteConnection::Error QgsSpatiaLiteConnection::fetchTables( bool loadGe
87
87
if ( ret == LayoutCurrent && recentVersion == false )
88
88
{
89
89
// obsolete library version
90
- mErrorMsg = tr ( " obsolete libspatialite: connecting to this DB requires using v.4.0 (or any subsequent)" );
91
- return FailedToCheckMetadata;
90
+ mErrorMsg = tr ( " obsolete libspatialite: connecting to this DB requires using v.4.0 (or any subsequent)" );
91
+ return FailedToCheckMetadata;
92
92
}
93
93
94
94
#ifdef SPATIALITE_RECENT_VERSION
95
95
// only if libspatialite version is >= 4.0.0
96
- // using v.4.0 Abstract Interface
97
- if (!getTableInfoAbstractInterface ( handle, loadGeometrylessTables ) )
98
- {
99
- return FailedToGetTables;
100
- }
101
- closeSpatiaLiteDb ( handle );
102
- return NoError;
96
+ // using v.4.0 Abstract Interface
97
+ if ( !getTableInfoAbstractInterface ( handle, loadGeometrylessTables ) )
98
+ {
99
+ return FailedToGetTables;
100
+ }
101
+ closeSpatiaLiteDb ( handle );
102
+ return NoError;
103
103
#endif
104
104
105
105
// obsolete library: still using the traditional approach
@@ -129,10 +129,10 @@ bool QgsSpatiaLiteConnection::updateStatistics()
129
129
// checking the library version
130
130
bool recentVersion = false ;
131
131
const char *version = spatialite_version ();
132
- if ( isdigit (*version) && *version >= ' 4' )
133
- recentVersion = true ;
132
+ if ( isdigit ( *version ) && *version >= ' 4' )
133
+ recentVersion = true ;
134
134
135
- bool ret = update_layer_statistics ( handle, NULL , NULL );
135
+ bool ret = update_layer_statistics ( handle, NULL , NULL );
136
136
137
137
closeSpatiaLiteDb ( handle );
138
138
@@ -144,7 +144,7 @@ sqlite3 *QgsSpatiaLiteConnection::openSpatiaLiteDb( QString path )
144
144
sqlite3 *handle = NULL ;
145
145
int ret;
146
146
// activating the SpatiaLite library
147
- spatialite_init (0 );
147
+ spatialite_init ( 0 );
148
148
149
149
// trying to open the SQLite DB
150
150
ret = sqlite3_open_v2 ( path.toUtf8 ().constData (), &handle, SQLITE_OPEN_READWRITE, NULL );
@@ -275,7 +275,7 @@ int QgsSpatiaLiteConnection::checkHasMetadataTables( sqlite3* handle )
275
275
}
276
276
277
277
#ifdef SPATIALITE_RECENT_VERSION
278
- // only if libspatialite version is >= 4.0.0
278
+ // only if libspatialite version is >= 4.0.0
279
279
bool QgsSpatiaLiteConnection::getTableInfoAbstractInterface ( sqlite3 * handle, bool loadGeometrylessTables )
280
280
{
281
281
int ret;
@@ -289,7 +289,7 @@ bool QgsSpatiaLiteConnection::getTableInfoAbstractInterface( sqlite3 * handle, b
289
289
gaiaVectorLayersListPtr list;
290
290
291
291
const char *version = spatialite_version ();
292
- if ( isdigit (*version) && *version >= ' 4' )
292
+ if ( isdigit ( *version ) && *version >= ' 4' )
293
293
; // OK, linked against libspatialite v.4.0 (or any subsequent)
294
294
else
295
295
{
@@ -298,14 +298,14 @@ bool QgsSpatiaLiteConnection::getTableInfoAbstractInterface( sqlite3 * handle, b
298
298
}
299
299
300
300
// attempting to load the VectorLayersList
301
- list = gaiaGetVectorLayersList ( handle, NULL , NULL , GAIA_VECTORS_LIST_FAST);
302
- if (list != NULL )
301
+ list = gaiaGetVectorLayersList ( handle, NULL , NULL , GAIA_VECTORS_LIST_FAST );
302
+ if ( list != NULL )
303
303
{
304
304
gaiaVectorLayerPtr lyr = list->First ;
305
305
while ( lyr != NULL )
306
306
{
307
307
// populating the QGIS own Layers List
308
- if (lyr->AuthInfos )
308
+ if ( lyr->AuthInfos )
309
309
{
310
310
if ( lyr->AuthInfos ->IsHidden )
311
311
{
@@ -318,39 +318,39 @@ bool QgsSpatiaLiteConnection::getTableInfoAbstractInterface( sqlite3 * handle, b
318
318
QString tableName = QString::fromUtf8 ( lyr->TableName );
319
319
QString column = QString::fromUtf8 ( lyr->GeometryName );
320
320
QString type = tr ( " UNKNOWN" );
321
- switch (lyr->GeometryType )
321
+ switch ( lyr->GeometryType )
322
322
{
323
323
case GAIA_VECTOR_GEOMETRY:
324
- type = tr ( " GEOMETRY" );
325
- break ;
324
+ type = tr ( " GEOMETRY" );
325
+ break ;
326
326
case GAIA_VECTOR_POINT:
327
- type = tr ( " POINT" );
328
- break ;
327
+ type = tr ( " POINT" );
328
+ break ;
329
329
case GAIA_VECTOR_LINESTRING:
330
- type = tr ( " LINESTRING" );
331
- break ;
330
+ type = tr ( " LINESTRING" );
331
+ break ;
332
332
case GAIA_VECTOR_POLYGON:
333
- type = tr ( " POLYGON" );
334
- break ;
333
+ type = tr ( " POLYGON" );
334
+ break ;
335
335
case GAIA_VECTOR_MULTIPOINT:
336
- type = tr ( " MULTIPOINT" );
337
- break ;
336
+ type = tr ( " MULTIPOINT" );
337
+ break ;
338
338
case GAIA_VECTOR_MULTILINESTRING:
339
- type = tr ( " MULTILINESTRING" );
340
- break ;
339
+ type = tr ( " MULTILINESTRING" );
340
+ break ;
341
341
case GAIA_VECTOR_MULTIPOLYGON:
342
- type = tr ( " MULTIPOLYGON" );
343
- break ;
342
+ type = tr ( " MULTIPOLYGON" );
343
+ break ;
344
344
case GAIA_VECTOR_GEOMETRYCOLLECTION:
345
- type = tr ( " GEOMETRYCOLLECTION" );
346
- break ;
345
+ type = tr ( " GEOMETRYCOLLECTION" );
346
+ break ;
347
347
};
348
348
mTables .append ( TableEntry ( tableName, column, type ) );
349
349
ok = true ;
350
350
351
351
lyr = lyr->Next ;
352
352
}
353
- gaiaFreeVectorLayersList ( list);
353
+ gaiaFreeVectorLayersList ( list );
354
354
}
355
355
356
356
if ( loadGeometrylessTables )
0 commit comments