Skip to content
Permalink
Browse files

store original layer id in the layers customProperties

  • Loading branch information
signedav authored and nyalldawson committed Sep 14, 2020
1 parent a667844 commit 9ea7f449e4cc1e17318ef58cc1bff839f48c1945
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/core/qgsofflineediting.cpp
@@ -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"

@@ -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(

0 comments on commit 9ea7f44

Please sign in to comment.
You can’t perform that action at this time.