Skip to content

Commit 3dbf70f

Browse files
committedJan 22, 2015
Offline editing: preserve scale based visibility
1 parent 34dc427 commit 3dbf70f

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed
 

‎src/core/qgsofflineediting.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -838,17 +838,15 @@ void QgsOfflineEditing::updateFidLookup( QgsVectorLayer* remoteLayer, sqlite3* d
838838
}
839839
}
840840

841-
void QgsOfflineEditing::copySymbology( const QgsVectorLayer* sourceLayer, QgsVectorLayer* targetLayer )
841+
void QgsOfflineEditing::copySymbology( QgsVectorLayer* sourceLayer, QgsVectorLayer* targetLayer )
842842
{
843843
QString error;
844844
QDomDocument doc;
845-
QDomElement node = doc.createElement( "symbology" );
846-
doc.appendChild( node );
847-
sourceLayer->writeSymbology( node, doc, error );
845+
sourceLayer->exportNamedStyle( doc, error );
848846

849847
if ( error.isEmpty() )
850848
{
851-
targetLayer->readSymbology( node, error );
849+
targetLayer->importNamedStyle( doc, error );
852850
}
853851
if ( !error.isEmpty() )
854852
{

‎src/core/qgsofflineediting.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ class CORE_EXPORT QgsOfflineEditing : public QObject
104104
void applyAttributeValueChanges( QgsVectorLayer* offlineLayer, QgsVectorLayer* remoteLayer, sqlite3* db, int layerId, int commitNo );
105105
void applyGeometryChanges( QgsVectorLayer* remoteLayer, sqlite3* db, int layerId, int commitNo );
106106
void updateFidLookup( QgsVectorLayer* remoteLayer, sqlite3* db, int layerId );
107-
void copySymbology( const QgsVectorLayer* sourceLayer, QgsVectorLayer* targetLayer );
107+
void copySymbology( QgsVectorLayer* sourceLayer, QgsVectorLayer* targetLayer );
108108
QMap<int, int> attributeLookup( QgsVectorLayer* offlineLayer, QgsVectorLayer* remoteLayer );
109109

110110
void showWarning( const QString& message );

0 commit comments

Comments
 (0)
Please sign in to comment.