Skip to content
Permalink
Browse files

Move QgsConfigurationMap to QgsXmlUtils

  • Loading branch information
m-kuhn committed Dec 20, 2016
1 parent afacbb1 commit 0190e506a6cbe2a9028e9611ff9319f4b0f66f56
@@ -31,7 +31,6 @@
%Include qgscolorschemeregistry.sip
%Include qgsconditionalstyle.sip
%Include qgscontexthelp.sip
%Include qgsconfigurationmap.sip
%Include qgscoordinatereferencesystem.sip
%Include qgscoordinatetransform.sip
%Include qgscredentials.sip

This file was deleted.

@@ -28,4 +28,6 @@ class QgsXmlUtils
static QDomElement writeMapUnits( QgsUnitTypes::DistanceUnit units, QDomDocument& doc );

static QDomElement writeRectangle( const QgsRectangle& rect, QDomDocument& doc );
static QDomElement writeVariant( const QVariant& value, QDomDocument& doc );
static QVariant readVariant( const QDomElement& element );
};
@@ -97,7 +97,6 @@ SET(QGIS_CORE_SRCS
qgscolorscheme.cpp
qgscolorschemeregistry.cpp
qgsconditionalstyle.cpp
qgsconfigurationmap.cpp
qgscontexthelp.cpp
qgscoordinatereferencesystem.cpp
qgscoordinatetransform.cpp
@@ -639,7 +638,6 @@ SET(QGIS_CORE_HDRS
qgscolorramp.h
qgscolorscheme.h
qgscolorschemeregistry.h
qgsconfigurationmap.h
qgsconnectionpool.h
qgscontexthelp.h
qgsconditionalstyle.h

This file was deleted.

This file was deleted.

@@ -30,7 +30,7 @@
#include "qgsprojectproperty.h"
#include "qgsrasterbandstats.h"
#include "qgsrasterdataprovider.h"
#include "qgsconfigurationmap.h"
#include "qgsxmlutils.h"

typedef QgsProjectVersion PFV;

@@ -699,8 +699,7 @@ void QgsProjectFileTransform::transform2180to2990()
editWidgetConfiguration.insert( QStringLiteral( "map" ), map );
}

QgsConfigurationMap editWidgetConfigurationMap( editWidgetConfiguration );
editWidgetConfigurationMap.toXml( editWidgetConfigElement );
editWidgetConfigElement.appendChild( QgsXmlUtils::writeVariant( editWidgetConfiguration, mDom ) );
}
}
}
@@ -82,7 +82,7 @@
#include "qgssimplifymethod.h"
#include "qgsexpressioncontext.h"
#include "qgsfeedback.h"
#include "qgsconfigurationmap.h"
#include "qgsxmlutils.h"

#include "diagram/qgsdiagram.h"

@@ -1847,9 +1847,9 @@ bool QgsVectorLayer::readSymbology( const QDomNode& layerNode, QString& errorMes

const QString widgetType = fieldWidgetElement.attribute( QStringLiteral( "type" ) );
const QDomElement cfgElem = fieldConfigElement.elementsByTagName( QStringLiteral( "config" ) ).at( 0 ).toElement();
QgsConfigurationMap editWidgetConfiguration;
editWidgetConfiguration.fromXml( cfgElem );
QgsEditorWidgetSetup setup = QgsEditorWidgetSetup( widgetType, editWidgetConfiguration.get() );
const QDomElement optionsElem = cfgElem.childNodes().at( 0 ).toElement();
QVariantMap optionsMap = QgsXmlUtils::readVariant( optionsElem ).toMap();
QgsEditorWidgetSetup setup = QgsEditorWidgetSetup( widgetType, optionsMap );
mFieldWidgetSetups[fieldName] = setup;
}

@@ -1997,7 +1997,7 @@ bool QgsVectorLayer::writeSymbology( QDomNode& node, QDomDocument& doc, QString&
editWidgetElement.setAttribute( "type", field.editorWidgetSetup().type() );
QDomElement editWidgetConfigElement = doc.createElement( QStringLiteral( "config" ) );

QgsConfigurationMap( widgetSetup.config() ).toXml( editWidgetConfigElement );
editWidgetConfigElement.appendChild( QgsXmlUtils::writeVariant( widgetSetup.config() , doc ) );
editWidgetElement.appendChild( editWidgetConfigElement );
// END TODO : wrap this part in an if to only save if it was user-modified

0 comments on commit 0190e50

Please sign in to comment.
You can’t perform that action at this time.