Skip to content

Commit 47ab9b8

Browse files
committed
remove const for QgsReadWriteContext to allow bringing up error messages
1 parent f271300 commit 47ab9b8

21 files changed

+54
-47
lines changed

python/core/qgseditformconfig.sip.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ Set type of feature form pop-up suppression after feature creation (overrides ap
252252
%End
253253

254254

255-
void readXml( const QDomNode &node, const QgsReadWriteContext &context );
255+
void readXml( const QDomNode &node, QgsReadWriteContext &context );
256256
%Docstring
257257
Read XML information
258258
Deserialize on project load

python/core/qgslayerdefinition.sip.in

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ files also store the layer tree info for the exported layers, including group in
2929
%Docstring
3030
Loads the QLR at path into QGIS. New layers are added to given project into layer tree specified by rootGroup
3131
%End
32-
static bool loadLayerDefinition( QDomDocument doc, QgsProject *project, QgsLayerTreeGroup *rootGroup, QString &errorMessage /Out/, const QgsReadWriteContext &context );
32+
static bool loadLayerDefinition( QDomDocument doc, QgsProject *project, QgsLayerTreeGroup *rootGroup, QString &errorMessage /Out/, QgsReadWriteContext &context );
3333
%Docstring
3434
Loads the QLR from the XML document. New layers are added to given project into layer tree specified by rootGroup
3535
%End
@@ -54,7 +54,7 @@ This is a low-level routine that does not write layer tree.
5454
.. seealso:: :py:func:`exportLayerDefinition`
5555
%End
5656

57-
static QList<QgsMapLayer *> loadLayerDefinitionLayers( QDomDocument &document, const QgsReadWriteContext &context ) /Factory/;
57+
static QList<QgsMapLayer *> loadLayerDefinitionLayers( QDomDocument &document, QgsReadWriteContext &context ) /Factory/;
5858
%Docstring
5959
Creates new layers from a layer definition document.
6060
This is a low-level routine that does not resolve layer ID conflicts, dependencies and joins

python/core/qgsmaplayer.sip.in

+4-4
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ Returns true if the layer is considered a spatial layer, ie it has some form of
452452
.. versionadded:: 2.16
453453
%End
454454

455-
bool readLayerXml( const QDomElement &layerElement, const QgsReadWriteContext &context );
455+
bool readLayerXml( const QDomElement &layerElement, QgsReadWriteContext &context );
456456
%Docstring
457457
Sets state from Dom document
458458

@@ -825,7 +825,7 @@ the SLD file could not be loaded
825825

826826

827827

828-
virtual bool readSymbology( const QDomNode &node, QString &errorMessage, const QgsReadWriteContext &context ) = 0;
828+
virtual bool readSymbology( const QDomNode &node, QString &errorMessage, QgsReadWriteContext &context ) = 0;
829829
%Docstring
830830
Read the symbology for the current layer from the Dom node supplied.
831831

@@ -836,7 +836,7 @@ Read the symbology for the current layer from the Dom node supplied.
836836
:return: true in case of success.
837837
%End
838838

839-
virtual bool readStyle( const QDomNode &node, QString &errorMessage, const QgsReadWriteContext &context );
839+
virtual bool readStyle( const QDomNode &node, QString &errorMessage, QgsReadWriteContext &context );
840840
%Docstring
841841
Read the style for the current layer from the Dom node supplied.
842842

@@ -1361,7 +1361,7 @@ Set the extent
13611361
Set whether layer is valid or not - should be used in constructor.
13621362
%End
13631363

1364-
virtual bool readXml( const QDomNode &layer_node, const QgsReadWriteContext &context );
1364+
virtual bool readXml( const QDomNode &layer_node, QgsReadWriteContext &context );
13651365
%Docstring
13661366
Called by readLayerXML(), used by children to read state specific to them from
13671367
project files.

python/core/qgsvectorlayer.sip.in

+3-3
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,7 @@ Return the provider type for this layer
728728
virtual QString sourceName() const;
729729

730730

731-
virtual bool readXml( const QDomNode &layer_node, const QgsReadWriteContext &context );
731+
virtual bool readXml( const QDomNode &layer_node, QgsReadWriteContext &context );
732732

733733
%Docstring
734734
Reads vector layer specific state from project file Dom node.
@@ -849,7 +849,7 @@ Returns the current auxiliary layer.
849849
%End
850850

851851

852-
virtual bool readSymbology( const QDomNode &layerNode, QString &errorMessage, const QgsReadWriteContext &context );
852+
virtual bool readSymbology( const QDomNode &layerNode, QString &errorMessage, QgsReadWriteContext &context );
853853

854854
%Docstring
855855
Read the symbology for the current layer from the Dom node supplied.
@@ -861,7 +861,7 @@ Read the symbology for the current layer from the Dom node supplied.
861861
:return: true in case of success.
862862
%End
863863

864-
virtual bool readStyle( const QDomNode &node, QString &errorMessage, const QgsReadWriteContext &context );
864+
virtual bool readStyle( const QDomNode &node, QString &errorMessage, QgsReadWriteContext &context );
865865

866866
%Docstring
867867
Read the style for the current layer from the Dom node supplied.

python/core/raster/qgsrasterlayer.sip.in

+3-3
Original file line numberDiff line numberDiff line change
@@ -354,19 +354,19 @@ Time stamp of data source in the moment when data/metadata were loaded by provid
354354
void showStatusMessage( const QString &message );
355355

356356
protected:
357-
virtual bool readSymbology( const QDomNode &node, QString &errorMessage, const QgsReadWriteContext &context );
357+
virtual bool readSymbology( const QDomNode &node, QString &errorMessage, QgsReadWriteContext &context );
358358

359359
%Docstring
360360
Read the symbology for the current layer from the Dom node supplied
361361
%End
362362

363-
virtual bool readStyle( const QDomNode &node, QString &errorMessage, const QgsReadWriteContext &context );
363+
virtual bool readStyle( const QDomNode &node, QString &errorMessage, QgsReadWriteContext &context );
364364

365365
%Docstring
366366
Read the style information for the current layer from the Dom node supplied
367367
%End
368368

369-
virtual bool readXml( const QDomNode &layer_node, const QgsReadWriteContext &context );
369+
virtual bool readXml( const QDomNode &layer_node, QgsReadWriteContext &context );
370370

371371
%Docstring
372372
Reads layer specific state from project file Dom node

src/app/qgisapp.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -8928,8 +8928,10 @@ void QgisApp::duplicateVectorStyle( QgsVectorLayer *srcLayer, QgsVectorLayer *de
89288928
rootNode.setAttribute( QStringLiteral( "version" ), Qgis::QGIS_VERSION );
89298929
doc.appendChild( rootNode );
89308930
QString errorMsg;
8931-
srcLayer->writeSymbology( rootNode, doc, errorMsg, QgsReadWriteContext() );
8932-
destLayer->readSymbology( rootNode, errorMsg, QgsReadWriteContext() );
8931+
QgsReadWriteContext writeContext = QgsReadWriteContext();
8932+
srcLayer->writeSymbology( rootNode, doc, errorMsg, writeContext );
8933+
QgsReadWriteContext readContext = QgsReadWriteContext();
8934+
destLayer->readSymbology( rootNode, errorMsg, readContext );
89338935
}
89348936
}
89358937

src/app/qgslayerstylingwidget.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -542,14 +542,16 @@ QgsMapLayerStyleCommand::QgsMapLayerStyleCommand( QgsMapLayer *layer, const QStr
542542
void QgsMapLayerStyleCommand::undo()
543543
{
544544
QString error;
545-
mLayer->readStyle( mLastState, error, QgsReadWriteContext() );
545+
QgsReadWriteContext context = QgsReadWriteContext();
546+
mLayer->readStyle( mLastState, error, context );
546547
mLayer->triggerRepaint();
547548
}
548549

549550
void QgsMapLayerStyleCommand::redo()
550551
{
551552
QString error;
552-
mLayer->readStyle( mXml, error, QgsReadWriteContext() );
553+
QgsReadWriteContext context = QgsReadWriteContext();
554+
mLayer->readStyle( mXml, error, context );
553555
mLayer->triggerRepaint();
554556
}
555557

src/core/qgseditformconfig.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ void QgsEditFormConfig::setSuppress( QgsEditFormConfig::FeatureFormSuppress s )
258258
d->mSuppressForm = s;
259259
}
260260

261-
void QgsEditFormConfig::readXml( const QDomNode &node, const QgsReadWriteContext &context )
261+
void QgsEditFormConfig::readXml( const QDomNode &node, QgsReadWriteContext &context )
262262
{
263263
d.detach();
264264

src/core/qgseditformconfig.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ class CORE_EXPORT QgsEditFormConfig
273273
* Read XML information
274274
* Deserialize on project load
275275
*/
276-
void readXml( const QDomNode &node, const QgsReadWriteContext &context );
276+
void readXml( const QDomNode &node, QgsReadWriteContext &context );
277277

278278
/**
279279
* Write XML information

src/core/qgslayerdefinition.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ bool QgsLayerDefinition::loadLayerDefinition( const QString &path, QgsProject *p
5656
return loadLayerDefinition( doc, project, rootGroup, errorMessage, context );
5757
}
5858

59-
bool QgsLayerDefinition::loadLayerDefinition( QDomDocument doc, QgsProject *project, QgsLayerTreeGroup *rootGroup, QString &errorMessage, const QgsReadWriteContext &context )
59+
bool QgsLayerDefinition::loadLayerDefinition( QDomDocument doc, QgsProject *project, QgsLayerTreeGroup *rootGroup, QString &errorMessage, QgsReadWriteContext &context )
6060
{
6161
Q_UNUSED( errorMessage );
6262

@@ -238,7 +238,7 @@ QDomDocument QgsLayerDefinition::exportLayerDefinitionLayers( const QList<QgsMap
238238
return doc;
239239
}
240240

241-
QList<QgsMapLayer *> QgsLayerDefinition::loadLayerDefinitionLayers( QDomDocument &document, const QgsReadWriteContext &context )
241+
QList<QgsMapLayer *> QgsLayerDefinition::loadLayerDefinitionLayers( QDomDocument &document, QgsReadWriteContext &context )
242242
{
243243
QList<QgsMapLayer *> layers;
244244
QDomNodeList layernodes = document.elementsByTagName( QStringLiteral( "maplayer" ) );

src/core/qgslayerdefinition.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class CORE_EXPORT QgsLayerDefinition
4545
//! Loads the QLR at path into QGIS. New layers are added to given project into layer tree specified by rootGroup
4646
static bool loadLayerDefinition( const QString &path, QgsProject *project, QgsLayerTreeGroup *rootGroup, QString &errorMessage SIP_OUT );
4747
//! Loads the QLR from the XML document. New layers are added to given project into layer tree specified by rootGroup
48-
static bool loadLayerDefinition( QDomDocument doc, QgsProject *project, QgsLayerTreeGroup *rootGroup, QString &errorMessage SIP_OUT, const QgsReadWriteContext &context );
48+
static bool loadLayerDefinition( QDomDocument doc, QgsProject *project, QgsLayerTreeGroup *rootGroup, QString &errorMessage SIP_OUT, QgsReadWriteContext &context );
4949
//! Export the selected layer tree nodes to a QLR file
5050
static bool exportLayerDefinition( QString path, const QList<QgsLayerTreeNode *> &selectedTreeNodes, QString &errorMessage SIP_OUT );
5151
//! Export the selected layer tree nodes to a QLR-XML document
@@ -67,7 +67,7 @@ class CORE_EXPORT QgsLayerDefinition
6767
* This is a low-level routine that does not resolve layer ID conflicts, dependencies and joins
6868
* \see loadLayerDefinition()
6969
*/
70-
static QList<QgsMapLayer *> loadLayerDefinitionLayers( QDomDocument &document, const QgsReadWriteContext &context ) SIP_FACTORY;
70+
static QList<QgsMapLayer *> loadLayerDefinitionLayers( QDomDocument &document, QgsReadWriteContext &context ) SIP_FACTORY;
7171

7272
/**
7373
* Creates new layers from a layer definition file (.QLR)

src/core/qgsmaplayer.cpp

+5-4
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ QPainter::CompositionMode QgsMapLayer::blendMode() const
202202
}
203203

204204

205-
bool QgsMapLayer::readLayerXml( const QDomElement &layerElement, const QgsReadWriteContext &context )
205+
bool QgsMapLayer::readLayerXml( const QDomElement &layerElement, QgsReadWriteContext &context )
206206
{
207207
bool layerError;
208208

@@ -559,7 +559,7 @@ bool QgsMapLayer::readLayerXml( const QDomElement &layerElement, const QgsReadWr
559559
} // bool QgsMapLayer::readLayerXML
560560

561561

562-
bool QgsMapLayer::readXml( const QDomNode &layer_node, const QgsReadWriteContext &context )
562+
bool QgsMapLayer::readXml( const QDomNode &layer_node, QgsReadWriteContext &context )
563563
{
564564
Q_UNUSED( layer_node );
565565
Q_UNUSED( context );
@@ -1310,7 +1310,8 @@ bool QgsMapLayer::importNamedStyle( QDomDocument &myDocument, QString &myErrorMe
13101310
setMinimumScale( myRoot.attribute( QStringLiteral( "minScale" ) ).toDouble() );
13111311
}
13121312

1313-
return readSymbology( myRoot, myErrorMessage, QgsReadWriteContext() ); // TODO: support relative paths in QML?
1313+
QgsReadWriteContext context = QgsReadWriteContext();
1314+
return readSymbology( myRoot, myErrorMessage, context ); // TODO: support relative paths in QML?
13141315
}
13151316

13161317
void QgsMapLayer::exportNamedMetadata( QDomDocument &doc, QString &errorMsg ) const
@@ -1791,7 +1792,7 @@ QString QgsMapLayer::loadSldStyle( const QString &uri, bool &resultFlag )
17911792
return QLatin1String( "" );
17921793
}
17931794

1794-
bool QgsMapLayer::readStyle( const QDomNode &node, QString &errorMessage, const QgsReadWriteContext &context )
1795+
bool QgsMapLayer::readStyle( const QDomNode &node, QString &errorMessage, QgsReadWriteContext &context )
17951796
{
17961797
Q_UNUSED( node );
17971798
Q_UNUSED( errorMessage );

src/core/qgsmaplayer.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ class CORE_EXPORT QgsMapLayer : public QObject
460460
461461
\returns true if successful
462462
*/
463-
bool readLayerXml( const QDomElement &layerElement, const QgsReadWriteContext &context );
463+
bool readLayerXml( const QDomElement &layerElement, QgsReadWriteContext &context );
464464

465465
/**
466466
* Stores state in Dom node
@@ -763,7 +763,7 @@ class CORE_EXPORT QgsMapLayer : public QObject
763763
* \param context reading context (used for transform from relative to absolute paths)
764764
* \returns true in case of success.
765765
*/
766-
virtual bool readSymbology( const QDomNode &node, QString &errorMessage, const QgsReadWriteContext &context ) = 0;
766+
virtual bool readSymbology( const QDomNode &node, QString &errorMessage, QgsReadWriteContext &context ) = 0;
767767

768768
/**
769769
* Read the style for the current layer from the Dom node supplied.
@@ -774,7 +774,7 @@ class CORE_EXPORT QgsMapLayer : public QObject
774774
* \since QGIS 2.16
775775
* \note To be implemented in subclasses. Default implementation does nothing and returns false.
776776
*/
777-
virtual bool readStyle( const QDomNode &node, QString &errorMessage, const QgsReadWriteContext &context );
777+
virtual bool readStyle( const QDomNode &node, QString &errorMessage, QgsReadWriteContext &context );
778778

779779
/**
780780
* Write the symbology for the layer into the docment provided.
@@ -1180,7 +1180,7 @@ class CORE_EXPORT QgsMapLayer : public QObject
11801180
* Called by readLayerXML(), used by children to read state specific to them from
11811181
* project files.
11821182
*/
1183-
virtual bool readXml( const QDomNode &layer_node, const QgsReadWriteContext &context );
1183+
virtual bool readXml( const QDomNode &layer_node, QgsReadWriteContext &context );
11841184

11851185
/**
11861186
* Called by writeLayerXML(), used by children to write state specific to them to

src/core/qgsproject.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -724,7 +724,7 @@ bool QgsProject::_getMapLayers( const QDomDocument &doc, QList<QDomNode> &broken
724724
return returnStatus;
725725
}
726726

727-
bool QgsProject::addLayer( const QDomElement &layerElem, QList<QDomNode> &brokenNodes, const QgsReadWriteContext &context )
727+
bool QgsProject::addLayer( const QDomElement &layerElem, QList<QDomNode> &brokenNodes, QgsReadWriteContext &context )
728728
{
729729
QString type = layerElem.attribute( QStringLiteral( "type" ) );
730730
QgsDebugMsgLevel( "Layer type is " + type, 4 );

src/core/qgsproject.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1134,7 +1134,7 @@ class CORE_EXPORT QgsProject : public QObject, public QgsExpressionContextGenera
11341134
* Creates layer and adds it to maplayer registry
11351135
* \note not available in Python bindings
11361136
*/
1137-
bool addLayer( const QDomElement &layerElem, QList<QDomNode> &brokenNodes, const QgsReadWriteContext &context ) SIP_SKIP;
1137+
bool addLayer( const QDomElement &layerElem, QList<QDomNode> &brokenNodes, QgsReadWriteContext &context ) SIP_SKIP;
11381138

11391139
//! \note not available in Python bindings
11401140
void initializeEmbeddedSubtree( const QString &projectFilePath, QgsLayerTreeGroup *group ) SIP_SKIP;

src/core/qgsvectorlayer.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -1353,7 +1353,7 @@ bool QgsVectorLayer::startEditing()
13531353
return true;
13541354
}
13551355

1356-
bool QgsVectorLayer::readXml( const QDomNode &layer_node, const QgsReadWriteContext &context )
1356+
bool QgsVectorLayer::readXml( const QDomNode &layer_node, QgsReadWriteContext &context )
13571357
{
13581358
QgsDebugMsgLevel( QStringLiteral( "Datasource in QgsVectorLayer::readXml: %1" ).arg( mDataSource.toLocal8Bit().data() ), 3 );
13591359

@@ -1686,7 +1686,7 @@ void QgsVectorLayer::resolveReferences( QgsProject *project )
16861686
}
16871687

16881688

1689-
bool QgsVectorLayer::readSymbology( const QDomNode &layerNode, QString &errorMessage, const QgsReadWriteContext &context )
1689+
bool QgsVectorLayer::readSymbology( const QDomNode &layerNode, QString &errorMessage, QgsReadWriteContext &context )
16901690
{
16911691
if ( !mExpressionFieldBuffer )
16921692
mExpressionFieldBuffer = new QgsExpressionFieldBuffer();
@@ -1876,7 +1876,7 @@ bool QgsVectorLayer::readSymbology( const QDomNode &layerNode, QString &errorMes
18761876
return true;
18771877
}
18781878

1879-
bool QgsVectorLayer::readStyle( const QDomNode &node, QString &errorMessage, const QgsReadWriteContext &context )
1879+
bool QgsVectorLayer::readStyle( const QDomNode &node, QString &errorMessage, QgsReadWriteContext &context )
18801880
{
18811881
bool result = true;
18821882
emit readCustomSymbology( node.toElement(), errorMessage );

src/core/qgsvectorlayer.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -756,7 +756,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
756756
* Reads vector layer specific state from project file Dom node.
757757
* \note Called by QgsMapLayer::readXml().
758758
*/
759-
bool readXml( const QDomNode &layer_node, const QgsReadWriteContext &context ) override;
759+
bool readXml( const QDomNode &layer_node, QgsReadWriteContext &context ) override;
760760

761761
/**
762762
* Write vector layer specific state to project file Dom node.
@@ -868,7 +868,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
868868
* \param context reading context (used for transform from relative to absolute paths)
869869
* \returns true in case of success.
870870
*/
871-
bool readSymbology( const QDomNode &layerNode, QString &errorMessage, const QgsReadWriteContext &context ) override;
871+
bool readSymbology( const QDomNode &layerNode, QString &errorMessage, QgsReadWriteContext &context ) override;
872872

873873
/**
874874
* Read the style for the current layer from the Dom node supplied.
@@ -877,7 +877,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
877877
* \param context reading context (used for transform from relative to absolute paths)
878878
* \returns true in case of success.
879879
*/
880-
bool readStyle( const QDomNode &node, QString &errorMessage, const QgsReadWriteContext &context ) override;
880+
bool readStyle( const QDomNode &node, QString &errorMessage, QgsReadWriteContext &context ) override;
881881

882882
/**
883883
* Write the symbology for the layer into the docment provided.

src/core/raster/qgsrasterlayer.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -1305,7 +1305,7 @@ QImage QgsRasterLayer::previewAsImage( QSize size, const QColor &bgColor, QImage
13051305
* @param errorMessage reference to string that will be updated with any error messages
13061306
* @return true in case of success.
13071307
*/
1308-
bool QgsRasterLayer::readSymbology( const QDomNode &layer_node, QString &errorMessage, const QgsReadWriteContext &context )
1308+
bool QgsRasterLayer::readSymbology( const QDomNode &layer_node, QString &errorMessage, QgsReadWriteContext &context )
13091309
{
13101310
Q_UNUSED( errorMessage );
13111311
QDomElement rasterRendererElem;
@@ -1397,7 +1397,7 @@ bool QgsRasterLayer::readSymbology( const QDomNode &layer_node, QString &errorMe
13971397
return true;
13981398
}
13991399

1400-
bool QgsRasterLayer::readStyle( const QDomNode &node, QString &errorMessage, const QgsReadWriteContext &context )
1400+
bool QgsRasterLayer::readStyle( const QDomNode &node, QString &errorMessage, QgsReadWriteContext &context )
14011401
{
14021402
return readSymbology( node, errorMessage, context );
14031403
} //readSymbology
@@ -1408,7 +1408,7 @@ bool QgsRasterLayer::readStyle( const QDomNode &node, QString &errorMessage, con
14081408
14091409
\note Called by QgsMapLayer::readXml().
14101410
*/
1411-
bool QgsRasterLayer::readXml( const QDomNode &layer_node, const QgsReadWriteContext &context )
1411+
bool QgsRasterLayer::readXml( const QDomNode &layer_node, QgsReadWriteContext &context )
14121412
{
14131413
QgsDebugMsgLevel( "Entered", 4 );
14141414
// Make sure to read the file first so stats etc are initialized properly!

src/core/raster/qgsrasterlayer.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -387,13 +387,13 @@ class CORE_EXPORT QgsRasterLayer : public QgsMapLayer
387387

388388
protected:
389389
//! \brief Read the symbology for the current layer from the Dom node supplied
390-
bool readSymbology( const QDomNode &node, QString &errorMessage, const QgsReadWriteContext &context ) override;
390+
bool readSymbology( const QDomNode &node, QString &errorMessage, QgsReadWriteContext &context ) override;
391391

392392
//! \brief Read the style information for the current layer from the Dom node supplied
393-
bool readStyle( const QDomNode &node, QString &errorMessage, const QgsReadWriteContext &context ) override;
393+
bool readStyle( const QDomNode &node, QString &errorMessage, QgsReadWriteContext &context ) override;
394394

395395
//! \brief Reads layer specific state from project file Dom node
396-
bool readXml( const QDomNode &layer_node, const QgsReadWriteContext &context ) override;
396+
bool readXml( const QDomNode &layer_node, QgsReadWriteContext &context ) override;
397397

398398
//! \brief Write the symbology for the layer into the docment provided
399399
bool writeSymbology( QDomNode &, QDomDocument &doc, QString &errorMessage, const QgsReadWriteContext &context ) const override;

tests/src/core/testqgsmaprendererjob.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,8 @@ void TestQgsMapRendererJob::testFourAdjacentTiles()
278278
}
279279

280280
QString errorMsg;
281-
if ( !vectorLayer->readSymbology( qmlDoc.documentElement(), errorMsg, QgsReadWriteContext() ) )
281+
QgsReadWriteContext context = QgsReadWriteContext();
282+
if ( !vectorLayer->readSymbology( qmlDoc.documentElement(), errorMsg, context ) )
282283
{
283284
QFAIL( errorMsg.toLocal8Bit().data() );
284285
}

0 commit comments

Comments
 (0)