Skip to content

Commit 309992b

Browse files
committed
Throw an assert when using an unsupported variant type
with QgsXmlUtils::writeVariant These were previously written as strings yet could not be restored by QgsXmlUtils::readVariant. Better to throw an assert so that it's clear that these types are unsupported and that support needs to be added.
1 parent 4ae23b6 commit 309992b

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/core/qgsxmlutils.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,7 @@ QDomElement QgsXmlUtils::writeVariant( const QVariant &value, QDomDocument &doc
154154
break;
155155

156156
default:
157-
element.setAttribute( QStringLiteral( "type" ), QStringLiteral( "Unknown" ) );
158-
element.setAttribute( QStringLiteral( "value" ), value.toString() );
157+
Q_ASSERT_X( false, "QgsXmlUtils::writeVariant", "unsupported variant type" );
159158
break;
160159
}
161160

0 commit comments

Comments
 (0)