Skip to content

Commit eea6eff

Browse files
committedJan 22, 2015
Offline editing: Use layer id instead of layer name for table name
Avoids table name collisions
1 parent 0bdebed commit eea6eff

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎src/core/qgsofflineediting.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ QgsVectorLayer* QgsOfflineEditing::copyVectorLayer( QgsVectorLayer* layer, sqlit
461461
return 0;
462462
}
463463

464-
QString tableName = layer->name();
464+
QString tableName = layer->id();
465465

466466
// create table
467467
QString sql = QString( "CREATE TABLE '%1' (" ).arg( tableName );
@@ -547,7 +547,7 @@ QgsVectorLayer* QgsOfflineEditing::copyVectorLayer( QgsVectorLayer* layer, sqlit
547547
QgsVectorLayer* newLayer = new QgsVectorLayer( QString( "dbname='%1' table='%2'%3 sql=" )
548548
.arg( offlineDbPath )
549549
.arg( tableName ).arg( layer->hasGeometryType() ? "(Geometry)" : "" ),
550-
tableName + " (offline)", "spatialite" );
550+
layer->name() + " (offline)", "spatialite" );
551551
if ( newLayer->isValid() )
552552
{
553553
// mark as offline layer

0 commit comments

Comments
 (0)
Please sign in to comment.