14
14
***************************************************************************/
15
15
#include " qgseditformconfig_p.h"
16
16
#include " qgseditformconfig.h"
17
+ #include " qgspathresolver.h"
17
18
#include " qgsproject.h"
19
+ #include " qgsreadwritecontext.h"
18
20
#include " qgsrelationmanager.h"
19
21
#include " qgslogger.h"
20
22
@@ -255,14 +257,14 @@ void QgsEditFormConfig::setSuppress( QgsEditFormConfig::FeatureFormSuppress s )
255
257
d->mSuppressForm = s;
256
258
}
257
259
258
- void QgsEditFormConfig::readXml ( const QDomNode &node )
260
+ void QgsEditFormConfig::readXml ( const QDomNode &node, const QgsReadWriteContext &context )
259
261
{
260
262
d.detach ();
261
263
QDomNode editFormNode = node.namedItem ( QStringLiteral ( " editform" ) );
262
264
if ( !editFormNode.isNull () )
263
265
{
264
266
QDomElement e = editFormNode.toElement ();
265
- d->mUiFormPath = QgsProject::instance ()-> readPath ( e.text () );
267
+ d->mUiFormPath = context. pathResolver (). readPath ( e.text () );
266
268
}
267
269
268
270
QDomNode editFormInitNode = node.namedItem ( QStringLiteral ( " editforminit" ) );
@@ -299,7 +301,7 @@ void QgsEditFormConfig::readXml( const QDomNode &node )
299
301
QDomNode editFormInitFilePathNode = node.namedItem ( QStringLiteral ( " editforminitfilepath" ) );
300
302
if ( !editFormInitFilePathNode.isNull () && !editFormInitFilePathNode.toElement ().text ().isEmpty () )
301
303
{
302
- setInitFilePath ( QgsProject::instance ()-> readPath ( editFormInitFilePathNode.toElement ().text () ) );
304
+ setInitFilePath ( context. pathResolver (). readPath ( editFormInitFilePathNode.toElement ().text () ) );
303
305
}
304
306
305
307
QDomNode fFSuppNode = node.namedItem ( QStringLiteral ( " featformsuppress" ) );
@@ -357,12 +359,12 @@ void QgsEditFormConfig::readXml( const QDomNode &node )
357
359
}
358
360
}
359
361
360
- void QgsEditFormConfig::writeXml ( QDomNode &node ) const
362
+ void QgsEditFormConfig::writeXml ( QDomNode &node, const QgsReadWriteContext &context ) const
361
363
{
362
364
QDomDocument doc ( node.ownerDocument () );
363
365
364
366
QDomElement efField = doc.createElement ( QStringLiteral ( " editform" ) );
365
- QDomText efText = doc.createTextNode ( QgsProject::instance ()-> writePath ( uiForm () ) );
367
+ QDomText efText = doc.createTextNode ( context. pathResolver (). writePath ( uiForm () ) );
366
368
efField.appendChild ( efText );
367
369
node.appendChild ( efField );
368
370
@@ -376,7 +378,7 @@ void QgsEditFormConfig::writeXml( QDomNode &node ) const
376
378
node.appendChild ( eficsField );
377
379
378
380
QDomElement efifpField = doc.createElement ( QStringLiteral ( " editforminitfilepath" ) );
379
- efifpField.appendChild ( doc.createTextNode ( QgsProject::instance ()-> writePath ( initFilePath () ) ) );
381
+ efifpField.appendChild ( doc.createTextNode ( context. pathResolver (). writePath ( initFilePath () ) ) );
380
382
node.appendChild ( efifpField );
381
383
382
384
QDomElement eficField = doc.createElement ( QStringLiteral ( " editforminitcode" ) );
0 commit comments