Skip to content

Commit d3ccd6e

Browse files
committedOct 22, 2018
use "gpkg_fid" as default FID column
1 parent b4da995 commit d3ccd6e

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed
 

‎src/core/qgsofflineediting.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -638,9 +638,7 @@ QgsVectorLayer *QgsOfflineEditing::copyVectorLayer( QgsVectorLayer *layer, sqlit
638638
options = CSLSetNameValue( options, "OVERWRITE", "YES" );
639639
options = CSLSetNameValue( options, "IDENTIFIER", tr( "%1 (offline)" ).arg( layer->name() ).toUtf8().constData() );
640640
options = CSLSetNameValue( options, "DESCRIPTION", layer->dataComment().toUtf8().constData() );
641-
#if 0
642-
options = CSLSetNameValue( options, "FID", featureId.toUtf8().constData() );
643-
#endif
641+
options = CSLSetNameValue( options, "FID", "gpkg_id" );
644642

645643
if ( layer->isSpatial() )
646644
{
@@ -750,7 +748,7 @@ QgsVectorLayer *QgsOfflineEditing::copyVectorLayer( QgsVectorLayer *layer, sqlit
750748
// fill gap in QgsAttributeMap if geometry column is not last (WORKAROUND)
751749
QgsAttributes attrs = f.attributes();
752750
int column = 0;
753-
if ( containerType == GPKG && layer->dataProvider()->fields().lookupField( "fid" ) == -1 )
751+
if ( containerType == GPKG && layer->dataProvider()->fields().lookupField( "gpkg_fid" ) == -1 )
754752
{
755753
// newAttrs has an addition FID attribute, so we have to add a dummy in the original set
756754
column++;

0 commit comments

Comments
 (0)
Please sign in to comment.