Skip to content
Permalink
Browse files
Introduce QgsReadWriteContext that encapsulates QgsPathResolver
This should make the read/write methods more flexible if we need to give them extra context.
  • Loading branch information
wonder-sk committed May 13, 2017
1 parent 15fc16d commit 23a7bd0fd9479d73638ceb73e895fbec87890fb0
Showing with 702 additions and 553 deletions.
  1. +5 −2 doc/api_break.dox
  2. +4 −4 python/core/annotations/qgsannotation.sip
  3. +2 −2 python/core/annotations/qgsannotationmanager.sip
  4. +2 −2 python/core/annotations/qgshtmlannotation.sip
  5. +2 −2 python/core/annotations/qgssvgannotation.sip
  6. +2 −2 python/core/annotations/qgstextannotation.sip
  7. +1 −0 python/core/core.sip
  8. +4 −4 python/core/qgsconditionalstyle.sip
  9. +13 −13 python/core/qgsdiagramrenderer.sip
  10. +6 −6 python/core/qgslayerdefinition.sip
  11. +14 −14 python/core/qgsmaplayer.sip
  12. +44 −0 python/core/qgsreadwritecontext.sip
  13. +10 −10 python/core/qgsvectorlayer.sip
  14. +6 −6 python/core/raster/qgsrasterlayer.sip
  15. +2 −2 python/core/symbology-ng/qgs25drenderer.sip
  16. +2 −2 python/core/symbology-ng/qgscategorizedsymbolrenderer.sip
  17. +2 −2 python/core/symbology-ng/qgsgraduatedsymbolrenderer.sip
  18. +2 −2 python/core/symbology-ng/qgsheatmaprenderer.sip
  19. +2 −2 python/core/symbology-ng/qgsinvertedpolygonrenderer.sip
  20. +2 −2 python/core/symbology-ng/qgsnullsymbolrenderer.sip
  21. +2 −2 python/core/symbology-ng/qgspointclusterrenderer.sip
  22. +2 −2 python/core/symbology-ng/qgspointdisplacementrenderer.sip
  23. +2 −2 python/core/symbology-ng/qgsrenderer.sip
  24. +2 −2 python/core/symbology-ng/qgsrendererregistry.sip
  25. +2 −2 python/core/symbology-ng/qgsrulebasedrenderer.sip
  26. +2 −2 python/core/symbology-ng/qgssinglesymbolrenderer.sip
  27. +6 −6 python/core/symbology-ng/qgssymbollayerutils.sip
  28. +2 −2 python/gui/qgsformannotation.sip
  29. +3 −3 src/app/qgisapp.cpp
  30. +9 −6 src/app/qgsdecorationgrid.cpp
  31. +5 −5 src/app/qgslayerstylingwidget.cpp
  32. +2 −0 src/core/CMakeLists.txt
  33. +6 −7 src/core/annotations/qgsannotation.cpp
  34. +4 −4 src/core/annotations/qgsannotation.h
  35. +10 −10 src/core/annotations/qgsannotationmanager.cpp
  36. +4 −4 src/core/annotations/qgsannotationmanager.h
  37. +4 −4 src/core/annotations/qgshtmlannotation.cpp
  38. +2 −2 src/core/annotations/qgshtmlannotation.h
  39. +4 −4 src/core/annotations/qgssvgannotation.cpp
  40. +2 −2 src/core/annotations/qgssvgannotation.h
  41. +4 −4 src/core/annotations/qgstextannotation.cpp
  42. +2 −2 src/core/annotations/qgstextannotation.h
  43. +9 −2 src/core/composer/qgscomposerarrow.cpp
  44. +6 −2 src/core/composer/qgscomposermap.cpp
  45. +11 −4 src/core/composer/qgscomposermapgrid.cpp
  46. +9 −2 src/core/composer/qgscomposermapoverview.cpp
  47. +9 −2 src/core/composer/qgscomposerpolygon.cpp
  48. +9 −2 src/core/composer/qgscomposerpolyline.cpp
  49. +9 −2 src/core/composer/qgscomposershape.cpp
  50. +9 −2 src/core/composer/qgscomposition.cpp
  51. +10 −10 src/core/qgsconditionalstyle.cpp
  52. +5 −5 src/core/qgsconditionalstyle.h
  53. +21 −60 src/core/qgsdiagramrenderer.cpp
  54. +13 −13 src/core/qgsdiagramrenderer.h
  55. +20 −11 src/core/qgslayerdefinition.cpp
  56. +5 −5 src/core/qgslayerdefinition.h
  57. +33 −32 src/core/qgsmaplayer.cpp
  58. +15 −15 src/core/qgsmaplayer.h
  59. +21 −10 src/core/qgsproject.cpp
  60. +1 −1 src/core/qgsproject.h
  61. +5 −1 src/core/qgsprojectfiletransform.cpp
  62. +6 −0 src/core/qgsreadwritecontext.cpp
  63. +44 −0 src/core/qgsreadwritecontext.h
  64. +19 −19 src/core/qgsvectorlayer.cpp
  65. +10 −10 src/core/qgsvectorlayer.h
  66. +12 −12 src/core/raster/qgsrasterlayer.cpp
  67. +6 −6 src/core/raster/qgsrasterlayer.h
  68. +4 −4 src/core/symbology-ng/qgs25drenderer.cpp
  69. +3 −2 src/core/symbology-ng/qgs25drenderer.h
  70. +6 −6 src/core/symbology-ng/qgscategorizedsymbolrenderer.cpp
  71. +2 −2 src/core/symbology-ng/qgscategorizedsymbolrenderer.h
  72. +6 −6 src/core/symbology-ng/qgsgraduatedsymbolrenderer.cpp
  73. +2 −2 src/core/symbology-ng/qgsgraduatedsymbolrenderer.h
  74. +4 −4 src/core/symbology-ng/qgsheatmaprenderer.cpp
  75. +2 −2 src/core/symbology-ng/qgsheatmaprenderer.h
  76. +4 −4 src/core/symbology-ng/qgsinvertedpolygonrenderer.cpp
  77. +2 −2 src/core/symbology-ng/qgsinvertedpolygonrenderer.h
  78. +4 −4 src/core/symbology-ng/qgsnullsymbolrenderer.cpp
  79. +3 −2 src/core/symbology-ng/qgsnullsymbolrenderer.h
  80. +6 −6 src/core/symbology-ng/qgspointclusterrenderer.cpp
  81. +2 −2 src/core/symbology-ng/qgspointclusterrenderer.h
  82. +6 −6 src/core/symbology-ng/qgspointdisplacementrenderer.cpp
  83. +2 −2 src/core/symbology-ng/qgspointdisplacementrenderer.h
  84. +4 −4 src/core/symbology-ng/qgsrenderer.cpp
  85. +3 −3 src/core/symbology-ng/qgsrenderer.h
  86. +5 −5 src/core/symbology-ng/qgsrendererregistry.h
  87. +4 −4 src/core/symbology-ng/qgsrulebasedrenderer.cpp
  88. +2 −2 src/core/symbology-ng/qgsrulebasedrenderer.h
  89. +4 −4 src/core/symbology-ng/qgssinglesymbolrenderer.cpp
  90. +2 −2 src/core/symbology-ng/qgssinglesymbolrenderer.h
  91. +7 −7 src/core/symbology-ng/qgsstyle.cpp
  92. +14 −13 src/core/symbology-ng/qgssymbollayerutils.cpp
  93. +10 −9 src/core/symbology-ng/qgssymbollayerutils.h
  94. +4 −4 src/gui/qgsformannotation.cpp
  95. +2 −2 src/gui/qgsformannotation.h
  96. +3 −3 src/gui/symbology-ng/qgsrulebasedrendererwidget.cpp
  97. +5 −5 src/plugins/grass/qgsgrasseditrenderer.cpp
  98. +2 −2 src/plugins/grass/qgsgrasseditrenderer.h
  99. +5 −1 src/server/qgsserverprojectparser.cpp
  100. +2 −2 tests/src/core/testqgsmaprendererjob.cpp
  101. +3 −3 tests/src/core/testqgsrulebasedrenderer.cpp
  102. +3 −3 tests/src/core/testqgsvectorlayerjoinbuffer.cpp
  103. +3 −3 tests/src/python/test_provider_memory.py
  104. +3 −3 tests/src/python/test_qgsgraduatedsymbolrenderer.py
  105. +3 −3 tests/src/python/test_qgsmaplayer.py
  106. +3 −3 tests/src/python/test_qgspointclusterrenderer.py
  107. +3 −3 tests/src/python/test_qgspointdisplacementrenderer.py
  108. +3 −3 tests/src/python/test_qgssymbollayer.py
  109. +17 −17 tests/src/python/test_qgsvectorlayer.py
@@ -920,6 +920,7 @@ QgsDiagramRenderer {#qgis_api_break_3_0_QgsDiagramRenderer}
- xform, fields were no longer required and are removed.
- referencedFields() no longer takes a QgsFields argument.
- renderDiagram() now takes an optional data defined overrides collection argument.
- readXml(), _readXml(), writeXml(), _writeXml() do not take QgsVectorLayer as an argument anymore.


QgsDiagramLayerSettings {#qgis_api_break_3_0_QgsDiagramLayerSettings}
@@ -951,11 +952,13 @@ setting data defined properties instead.
- The renderer member variable was removed, and getRenderer() was renamed to renderer()
- The showAll member variable was removed. setShowAllDiagrams() and showAllDiagrams() should be used instead.
- referencedFields() no longer requires a QgsFields argument.
- readXml() and writeXml() do not take QgsVectorLayer as an argument anymore.

QgsDiagramSettings {#qgis_api_break_3_0_QgsDiagramSettings}
------------------

- The SizeType enum was removed. Use QgsUnitTypes.RenderUnit instead.
- readXml() and writeXml() do not take QgsVectorLayer as an argument anymore.

QgsDial {#qgis_api_break_3_0_QgsDial}
-------
@@ -1280,7 +1283,7 @@ QgsLayerDefinition {#qgis_api_break_3_0_QgsLayerDefinition}
------------------

- loadLayerDefinition() now also requires QgsProject as the second argument
- loadLayerDefinition() and exportLayerDefinition() variants that take QDomDocument as the first argument now expect QgsPathResolver as the last argument
- loadLayerDefinition() and exportLayerDefinition() variants that take QDomDocument as the first argument now expect QgsReadWriteContext as the last argument


QgsLayerPropertiesWidget {#qgis_api_break_3_0_QgsLayerPropertiesWidget}
@@ -1413,7 +1416,7 @@ screenUpdateRequested() were removed. These members have had no effect for a num
- capitaliseLayerName() was renamed to capitalizeLayerName() <!--#spellok-->
- asLayerDefinition(), fromLayerDefinition(), fromLayerDefinitionFile() were moved to QgsLayerDefinition class and renamed to exportLayerDefinitionLayers() resp. loadLayerDefinitionLayers()
- loadNamedStyleFromDb() was renamed to loadNamedStyleFromDatabase()
- readLayerXml() and writeLayerXml() expect QgsPathResolver reference as the last argument
- readLayerXml() and writeLayerXml() expect QgsReadWriteContext reference as the last argument
- the invalidTransformInput() slot was removed - calling this slot had no effect
- metadata() was renamed to htmlMetadata()

@@ -56,8 +56,8 @@ class QgsAnnotation : QObject

void render( QgsRenderContext &context ) const;

virtual void writeXml( QDomElement &elem, QDomDocument &doc, const QgsPathResolver &pathResolver ) const = 0;
virtual void readXml( const QDomElement &itemElem, const QDomDocument &doc, const QgsPathResolver &pathResolver ) = 0;
virtual void writeXml( QDomElement& elem, QDomDocument & doc, const QgsReadWriteContext &context ) const = 0;
virtual void readXml( const QDomElement& itemElem, const QgsReadWriteContext &context ) = 0;

void setMarkerSymbol( QgsMarkerSymbol *symbol /Transfer/ );
QgsMarkerSymbol *markerSymbol() const;
@@ -80,8 +80,8 @@ class QgsAnnotation : QObject

virtual QSizeF minimumFrameSize() const;

void _writeXml( QDomElement &itemElem, QDomDocument &doc, const QgsPathResolver &pathResolver ) const;
void _readXml( const QDomElement &annotationElem, const QDomDocument &doc, const QgsPathResolver &pathResolver );
void _writeXml( QDomElement& itemElem, QDomDocument& doc, const QgsReadWriteContext &context ) const;
void _readXml( const QDomElement& annotationElem, const QgsReadWriteContext &context );

void copyCommonProperties( QgsAnnotation *target ) const;

@@ -81,15 +81,15 @@ class QgsAnnotationManager : QObject
:rtype: list of QgsAnnotation
%End

bool readXml( const QDomElement &element, const QDomDocument &doc, const QgsPathResolver &pathResolver );
bool readXml( const QDomElement &element, const QgsReadWriteContext &context );
%Docstring
Reads the manager's state from a DOM element, restoring all annotations
present in the XML document.
.. seealso:: writeXml()
:rtype: bool
%End

QDomElement writeXml( QDomDocument &doc, const QgsPathResolver &pathResolver ) const;
QDomElement writeXml( QDomDocument &doc, const QgsReadWriteContext &context ) const;
%Docstring
Returns a DOM element representing the state of the manager.
.. seealso:: readXml()
@@ -50,8 +50,8 @@ class QgsHtmlAnnotation: QgsAnnotation
:rtype: str
%End

virtual void writeXml( QDomElement &elem, QDomDocument &doc, const QgsPathResolver &pathResolver ) const;
virtual void readXml( const QDomElement &itemElem, const QDomDocument &doc, const QgsPathResolver &pathResolver );
virtual void writeXml( QDomElement &elem, QDomDocument &doc, const QgsReadWriteContext &context ) const;
virtual void readXml( const QDomElement &itemElem, const QgsReadWriteContext &context );

virtual void setAssociatedFeature( const QgsFeature &feature );

@@ -29,8 +29,8 @@ class QgsSvgAnnotation: QgsAnnotation
virtual QgsSvgAnnotation *clone() const /Factory/;


virtual void writeXml( QDomElement &elem, QDomDocument &doc, const QgsPathResolver &pathResolver ) const;
virtual void readXml( const QDomElement &itemElem, const QDomDocument &doc, const QgsPathResolver &pathResolver );
virtual void writeXml( QDomElement &elem, QDomDocument &doc, const QgsReadWriteContext &context ) const;
virtual void readXml( const QDomElement &itemElem, const QgsReadWriteContext &context );

void setFilePath( const QString &file );
%Docstring
@@ -44,8 +44,8 @@ class QgsTextAnnotation: QgsAnnotation
.. seealso:: document()
%End

virtual void writeXml( QDomElement &elem, QDomDocument &doc, const QgsPathResolver &pathResolver ) const;
virtual void readXml( const QDomElement &itemElem, const QDomDocument &doc, const QgsPathResolver &pathResolver );
virtual void writeXml( QDomElement &elem, QDomDocument &doc, const QgsReadWriteContext &context ) const;
virtual void readXml( const QDomElement &itemElem, const QgsReadWriteContext &context );

static QgsTextAnnotation *create() /Factory/;
%Docstring
@@ -136,6 +136,7 @@
%Include qgsproviderregistry.sip
%Include qgspythonrunner.sip
%Include qgsrange.sip
%Include qgsreadwritecontext.sip
%Include qgsrelation.sip
%Include qgsrelationmanager.sip
%Include qgsrenderchecker.sip
@@ -52,13 +52,13 @@ class QgsConditionalLayerStyles
:rtype: list of QgsConditionalStyle
%End

bool readXml( const QDomNode &node, const QgsPathResolver &pathResolver );
bool readXml( const QDomNode &node, const QgsReadWriteContext &context );
%Docstring
Reads field ui properties specific state from Dom node.
:rtype: bool
%End

bool writeXml( QDomNode &node, QDomDocument &doc, const QgsPathResolver &pathResolver ) const;
bool writeXml( QDomNode &node, QDomDocument &doc, const QgsReadWriteContext &context ) const;
%Docstring
Write field ui properties specific state from Dom node.
:rtype: bool
@@ -244,13 +244,13 @@ class QgsConditionalStyle
:rtype: QgsConditionalStyle
%End

bool readXml( const QDomNode &node, const QgsPathResolver &pathResolver );
bool readXml( const QDomNode &node, const QgsReadWriteContext &context );
%Docstring
Reads vector conditional style specific state from layer Dom node.
:rtype: bool
%End

bool writeXml( QDomNode &node, QDomDocument &doc, const QgsPathResolver &pathResolver ) const;
bool writeXml( QDomNode &node, QDomDocument &doc, const QgsReadWriteContext &context ) const;
%Docstring
Write vector conditional style specific state from layer Dom node.
:rtype: bool
@@ -199,9 +199,9 @@ class QgsDiagramLayerSettings
*/
void setShowAllDiagrams( bool showAllDiagrams );

void readXml( const QDomElement &elem, const QgsVectorLayer *layer );
void writeXml( QDomElement &layerElem, QDomDocument &doc, const QgsVectorLayer *layer ) const;
bool prepare( const QgsExpressionContext &context = QgsExpressionContext() ) const;
void readXml( const QDomElement& elem );
void writeXml( QDomElement& layerElem, QDomDocument& doc ) const;
bool prepare( const QgsExpressionContext& context = QgsExpressionContext() ) const;

/** Returns the set of any fields referenced by the layer's diagrams.
* @param context expression context the diagrams will be drawn using
@@ -294,8 +294,8 @@ class QgsDiagramSettings
//! Scale diagrams smaller than mMinimumSize to mMinimumSize
double minimumSize;

void readXml( const QDomElement &elem, const QgsVectorLayer *layer );
void writeXml( QDomElement &rendererElem, QDomDocument &doc, const QgsVectorLayer *layer ) const;
void readXml( const QDomElement& elem );
void writeXml( QDomElement& rendererElem, QDomDocument& doc ) const;

/** Returns list of legend nodes for the diagram
* @note caller is responsible for deletion of QgsLayerTreeModelLegendNodes
@@ -365,8 +365,8 @@ class QgsDiagramRenderer
/** Returns list with all diagram settings in the renderer*/
virtual QList<QgsDiagramSettings> diagramSettings() const = 0;

virtual void readXml( const QDomElement& elem, const QgsVectorLayer* layer, const QgsPathResolver &pathResolver ) = 0;
virtual void writeXml( QDomElement& layerElem, QDomDocument& doc, const QgsVectorLayer* layer, const QgsPathResolver &pathResolver ) const = 0;
virtual void readXml( const QDomElement& elem, const QgsReadWriteContext &context ) = 0;
virtual void writeXml( QDomElement& layerElem, QDomDocument& doc, const QgsReadWriteContext &context ) const = 0;

/** Returns list of legend nodes for the diagram
* @note caller is responsible for deletion of QgsLayerTreeModelLegendNodes
@@ -442,8 +442,8 @@ class QgsDiagramRenderer
static int dpiPaintDevice( const QPainter* );

//read / write diagram
void _readXml( const QDomElement& elem, const QgsVectorLayer* layer, const QgsPathResolver &pathResolver );
void _writeXml( QDomElement& rendererElem, QDomDocument& doc, const QgsVectorLayer* layer, const QgsPathResolver &pathResolver ) const;
void _readXml( const QDomElement& elem, const QgsReadWriteContext &context );
void _writeXml( QDomElement& rendererElem, QDomDocument& doc, const QgsReadWriteContext &context ) const;
};

/** Renders the diagrams for all features with the same settings*/
@@ -467,8 +467,8 @@ class QgsSingleCategoryDiagramRenderer : QgsDiagramRenderer

QList<QgsDiagramSettings> diagramSettings() const;

void readXml( const QDomElement& elem, const QgsVectorLayer* layer, const QgsPathResolver &pathResolver );
void writeXml( QDomElement& layerElem, QDomDocument& doc, const QgsVectorLayer* layer, const QgsPathResolver &pathResolver ) const;
void readXml( const QDomElement& elem, const QgsReadWriteContext &context );
void writeXml( QDomElement& layerElem, QDomDocument& doc, const QgsReadWriteContext &context ) const;

virtual QList< QgsLayerTreeModelLegendNode * > legendItems( QgsLayerTreeLayer *nodeLayer ) const /Factory/;

@@ -533,8 +533,8 @@ class QgsLinearlyInterpolatedDiagramRenderer : QgsDiagramRenderer
bool classificationAttributeIsExpression() const;
void setClassificationAttributeIsExpression( bool isExpression );

void readXml( const QDomElement& elem, const QgsVectorLayer* layer, const QgsPathResolver &pathResolver );
void writeXml( QDomElement& layerElem, QDomDocument& doc, const QgsVectorLayer* layer, const QgsPathResolver &pathResolver ) const;
void readXml( const QDomElement& elem, const QgsReadWriteContext &context );
void writeXml( QDomElement& layerElem, QDomDocument& doc, const QgsReadWriteContext &context ) const;

virtual QList< QgsLayerTreeModelLegendNode * > legendItems( QgsLayerTreeLayer *nodeLayer ) const /Factory/;

@@ -11,13 +11,13 @@ class QgsLayerDefinition
#include <qgslayerdefinition.h>
%End
public:
static bool loadLayerDefinition( const QString &path, QgsProject *project, QgsLayerTreeGroup *rootGroup, QString &errorMessage /Out/ );
static bool loadLayerDefinition( QDomDocument doc, QgsProject *project, QgsLayerTreeGroup *rootGroup, QString &errorMessage /Out/, const QgsPathResolver &pathResolver );
static bool exportLayerDefinition( QString path, const QList<QgsLayerTreeNode*> &selectedTreeNodes, QString &errorMessage /Out/ );
static bool exportLayerDefinition( QDomDocument doc, const QList<QgsLayerTreeNode*> &selectedTreeNodes, QString &errorMessage /Out/, const QgsPathResolver &pathResolver );
static bool loadLayerDefinition( const QString & path, QgsProject* project, QgsLayerTreeGroup* rootGroup, QString &errorMessage /Out/ );
static bool loadLayerDefinition( QDomDocument doc, QgsProject* project, QgsLayerTreeGroup* rootGroup, QString &errorMessage /Out/, const QgsReadWriteContext &context );
static bool exportLayerDefinition( QString path, const QList<QgsLayerTreeNode*>& selectedTreeNodes, QString &errorMessage /Out/ );
static bool exportLayerDefinition( QDomDocument doc, const QList<QgsLayerTreeNode*>& selectedTreeNodes, QString &errorMessage /Out/, const QgsReadWriteContext &context );

static QDomDocument exportLayerDefinitionLayers( const QList<QgsMapLayer*> &layers, const QgsPathResolver &pathResolver );
static QList<QgsMapLayer*> loadLayerDefinitionLayers( QDomDocument &document, const QgsPathResolver &pathResolver ) /Factory/;
static QDomDocument exportLayerDefinitionLayers( const QList<QgsMapLayer*>& layers, const QgsReadWriteContext &context );
static QList<QgsMapLayer*> loadLayerDefinitionLayers( QDomDocument& document, const QgsReadWriteContext &context ) /Factory/;
static QList<QgsMapLayer*> loadLayerDefinitionLayers( const QString &qlrfile ) /Factory/;

/**
@@ -409,11 +409,11 @@ Returns true if the layer can be edited.
:rtype: bool
%End

bool readLayerXml( const QDomElement &layerElement, const QgsPathResolver &pathResolver );
bool readLayerXml( const QDomElement &layerElement, const QgsReadWriteContext &context );
%Docstring
Sets state from Dom document
\param layerElement The Dom element corresponding to ``maplayer'' tag
\param pathResolver object for conversion between relative and absolute paths
\param context writing context (e.g. for conversion between relative and absolute paths)
\note

The Dom node corresponds to a Dom document project file XML element read
@@ -428,12 +428,12 @@ Invoked by QgsProject.read().
:rtype: bool
%End

bool writeLayerXml( QDomElement &layerElement, QDomDocument &document, const QgsPathResolver &pathResolver ) const;
bool writeLayerXml( QDomElement &layerElement, QDomDocument &document, const QgsReadWriteContext &context ) const;
%Docstring
Stores state in Dom node
\param layerElement is a Dom element corresponding to ``maplayer'' tag
\param document is a the dom document being written
\param pathResolver object for conversion between relative and absolute paths
\param context reading context (e.g. for conversion between relative and absolute paths)
\note

The Dom node corresponds to a Dom document project file XML element to be
@@ -629,22 +629,22 @@ A convenience function to (un)capitalize the layer name



virtual bool readSymbology( const QDomNode &node, QString &errorMessage, const QgsPathResolver &pathResolver ) = 0;
virtual bool readSymbology( const QDomNode &node, QString &errorMessage, const QgsReadWriteContext &context ) = 0;
%Docstring
Read the symbology for the current layer from the Dom node supplied.
\param node node that will contain the symbology definition for this layer.
\param errorMessage reference to string that will be updated with any error messages
\param pathResolver for transform from relative to absolute paths
\param context reading context (used for transform from relative to absolute paths)
:return: true in case of success.
:rtype: bool
%End

virtual bool readStyle( const QDomNode &node, QString &errorMessage, const QgsPathResolver &pathResolver );
virtual bool readStyle( const QDomNode &node, QString &errorMessage, const QgsReadWriteContext &context );
%Docstring
Read the style for the current layer from the Dom node supplied.
\param node node that will contain the style definition for this layer.
\param errorMessage reference to string that will be updated with any error messages
\param pathResolver for transform from relative to absolute paths
\param context reading context (used for transform from relative to absolute paths)
:return: true in case of success.
.. versionadded:: 2.16
.. note::
@@ -653,24 +653,24 @@ A convenience function to (un)capitalize the layer name
:rtype: bool
%End

virtual bool writeSymbology( QDomNode &node, QDomDocument &doc, QString &errorMessage, const QgsPathResolver &pathResolver ) const = 0;
virtual bool writeSymbology( QDomNode &node, QDomDocument &doc, QString &errorMessage, const QgsReadWriteContext &context ) const = 0;
%Docstring
Write the symbology for the layer into the docment provided.
\param node the node that will have the style element added to it.
\param doc the document that will have the QDomNode added.
\param errorMessage reference to string that will be updated with any error messages
\param pathResolver for transform from absolute to relative paths
\param context writing context (used for transform from absolute to relative paths)
:return: true in case of success.
:rtype: bool
%End

virtual bool writeStyle( QDomNode &node, QDomDocument &doc, QString &errorMessage, const QgsPathResolver &pathResolver ) const;
virtual bool writeStyle( QDomNode &node, QDomDocument &doc, QString &errorMessage, const QgsReadWriteContext &context ) const;
%Docstring
Write just the style information for the layer into the document
\param node the node that will have the style element added to it.
\param doc the document that will have the QDomNode added.
\param errorMessage reference to string that will be updated with any error messages
\param pathResolver for transform from absolute to relative paths
\param context writing context (used for transform from absolute to relative paths)
:return: true in case of success.
.. versionadded:: 2.16
.. note::
@@ -1030,14 +1030,14 @@ Set the extent
Set whether layer is valid or not - should be used in constructor.
%End

virtual bool readXml( const QDomNode &layer_node, const QgsPathResolver &pathResolver );
virtual bool readXml( const QDomNode &layer_node, const QgsReadWriteContext &context );
%Docstring
Called by readLayerXML(), used by children to read state specific to them from
project files.
:rtype: bool
%End

virtual bool writeXml( QDomNode &layer_node, QDomDocument &document, const QgsPathResolver &pathResolver ) const;
virtual bool writeXml( QDomNode &layer_node, QDomDocument &document, const QgsReadWriteContext &context ) const;
%Docstring
Called by writeLayerXML(), used by children to write state specific to them to
project files.

0 comments on commit 23a7bd0

Please sign in to comment.