Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix variant to json array handling
  • Loading branch information
stev-0 authored and nyalldawson committed Aug 15, 2019
1 parent 9a559ed commit ca6491a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/core/qgsjsonutils.cpp
Expand Up @@ -391,8 +391,8 @@ json QgsJsonUtils::jsonFromVariant( const QVariant &val )
json j;
if ( val.type() == QVariant::Type::Map )
{
const auto vMap { val.toMap() };
auto jMap { json::object() };
const auto vMap = val.toMap();
auto jMap = json::object();
for ( auto it = vMap.constBegin(); it != vMap.constEnd(); it++ )
{
jMap[ it.key().toStdString() ] = jsonFromVariant( it.value() );
Expand All @@ -401,8 +401,8 @@ json QgsJsonUtils::jsonFromVariant( const QVariant &val )
}
else if ( val.type() == QVariant::Type::List )
{
const auto vList{ val.toList() };
auto jList { json::array() };
const auto vList = val.toList();
auto jList = json::array();
for ( const auto &v : vList )
{
jList.push_back( jsonFromVariant( v ) );
Expand Down

0 comments on commit ca6491a

Please sign in to comment.