Skip to content
Permalink
Browse files

JSON formatting and prefix removal

  • Loading branch information
m-kuhn committed Aug 23, 2018
1 parent 4fecc2e commit 40d0dfa315048e80bbbefb632c639313691086d4
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/core/expression/qgsexpression.cpp
@@ -912,15 +912,15 @@ QString QgsExpression::formatPreviewString( const QVariant &value )
if ( separator.isEmpty() )
separator = QStringLiteral( ", " );

mapStr.append( it.key() ).append( ": " ).append( formatPreviewString( it.value() ) );
mapStr.append( QStringLiteral( "\"%1\": %2" ).arg( it.key(), formatPreviewString( it.value() ) ) );
if ( mapStr.length() > MAX_PREVIEW + 5 )
{
mapStr = tr( "%1…" ).arg( mapStr.left( MAX_PREVIEW ) );
break;
}
}
mapStr += QStringLiteral( " }" );
return tr( "<i>&lt;map: %1&gt;</i>" ).arg( mapStr );
return tr( "<i>&lt;%1&gt;</i>" ).arg( mapStr );
}
else if ( value.type() == QVariant::List || value.type() == QVariant::StringList )
{
@@ -941,7 +941,7 @@ QString QgsExpression::formatPreviewString( const QVariant &value )
}
}
listStr += QStringLiteral( " ]" );
return tr( "<i>&lt;array: %1&gt;</i>" ).arg( listStr );
return tr( "<i>&lt;%1&gt;</i>" ).arg( listStr );
}
else
{

0 comments on commit 40d0dfa

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