Skip to content

Commit

Permalink
store original layer id in the layers customProperties
Browse files Browse the repository at this point in the history
  • Loading branch information
signedav authored and nyalldawson committed Sep 14, 2020
1 parent a667844 commit 9ea7f44
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/core/qgsofflineediting.cpp
Expand Up @@ -60,6 +60,7 @@ extern "C"
#define CUSTOM_PROPERTY_REMOTE_SOURCE "remoteSource"
#define CUSTOM_PROPERTY_REMOTE_PROVIDER "remoteProvider"
#define CUSTOM_SHOW_FEATURE_COUNT "showFeatureCount"
#define CUSTOM_PROPERTY_ORIGINAL_LAYERID "remoteLayerId"
#define PROJECT_ENTRY_SCOPE_OFFLINE "OfflineEditingPlugin"
#define PROJECT_ENTRY_KEY_OFFLINE_DB_PATH "/OfflineDbPath"

Expand Down Expand Up @@ -858,9 +859,10 @@ QgsVectorLayer *QgsOfflineEditing::copyVectorLayer( QgsVectorLayer *layer, sqlit
// mark as offline layer
newLayer->setCustomProperty( CUSTOM_PROPERTY_IS_OFFLINE_EDITABLE, true );

// store original layer source
// store original layer source and information
newLayer->setCustomProperty( CUSTOM_PROPERTY_REMOTE_SOURCE, layer->source() );
newLayer->setCustomProperty( CUSTOM_PROPERTY_REMOTE_PROVIDER, layer->providerType() );
newLayer->setCustomProperty( CUSTOM_PROPERTY_ORIGINAL_LAYERID, layer->id() );

// register this layer with the central layers registry
QgsProject::instance()->addMapLayers(
Expand Down

0 comments on commit 9ea7f44

Please sign in to comment.