@@ -75,16 +75,32 @@ void QgsGeometryOptions::setCheckConfiguration( const QString &checkId, const QV
75
75
76
76
void QgsGeometryOptions::writeXml ( QDomNode &node ) const
77
77
{
78
- QDomElement geometryOptionsElement = node.ownerDocument ().createElement ( QStringLiteral ( " geometryOptions" ) );
78
+ QDomDocument doc = node.ownerDocument ();
79
+ QDomElement geometryOptionsElement = doc.createElement ( QStringLiteral ( " geometryOptions" ) );
79
80
node.appendChild ( geometryOptionsElement );
80
81
81
82
geometryOptionsElement.setAttribute ( QStringLiteral ( " removeDuplicateNodes" ), mRemoveDuplicateNodes ? 1 : 0 );
82
83
geometryOptionsElement.setAttribute ( QStringLiteral ( " geometryPrecision" ), mGeometryPrecision );
84
+
85
+ QDomElement activeCheckListElement = QgsXmlUtils::writeVariant ( mGeometryChecks , doc );
86
+ activeCheckListElement.setTagName ( QStringLiteral ( " activeChecks" ) );
87
+ geometryOptionsElement.appendChild ( activeCheckListElement );
88
+ QDomElement checkConfigurationElement = QgsXmlUtils::writeVariant ( mCheckConfiguration , doc );
89
+ checkConfigurationElement.setTagName ( QStringLiteral ( " checkConfiguration" ) );
90
+ geometryOptionsElement.appendChild ( checkConfigurationElement );
83
91
}
84
92
85
93
void QgsGeometryOptions::readXml ( const QDomNode &node )
86
94
{
87
95
QDomElement geometryOptionsElement = node.toElement ();
88
96
setGeometryPrecision ( geometryOptionsElement.attribute ( QStringLiteral ( " geometryPrecision" ), QStringLiteral ( " 0.0" ) ).toDouble () );
89
97
setRemoveDuplicateNodes ( geometryOptionsElement.attribute ( QStringLiteral ( " removeDuplicateNodes" ), QStringLiteral ( " 0" ) ).toInt () == 1 );
98
+
99
+ QDomElement activeChecksElem = node.namedItem ( QStringLiteral ( " activeChecks" ) ).toElement ();
100
+ const QVariant activeChecks = QgsXmlUtils::readVariant ( activeChecksElem );
101
+ setGeometryChecks ( activeChecks.toStringList () );
102
+
103
+ QDomElement checkConfigurationElem = node.namedItem ( QStringLiteral ( " checkConfiguration" ) ).toElement ();
104
+ const QVariant checkConfiguration = QgsXmlUtils::readVariant ( checkConfigurationElem );
105
+ mCheckConfiguration = checkConfiguration.toMap ();
90
106
}
0 commit comments