Skip to content

Commit

Permalink
Fix variant to json array handling
Browse files Browse the repository at this point in the history
  • Loading branch information
stev-0 authored and m-kuhn committed Aug 15, 2019
1 parent 2af4ad9 commit 371c7c7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/core/qgsjsonutils.cpp
Expand Up @@ -396,8 +396,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 @@ -406,8 +406,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 371c7c7

Please sign in to comment.