Skip to content

Commit

Permalink
Fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed May 27, 2019
1 parent 9167cb4 commit 76d9a26
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/core/fieldformatter/qgsvaluerelationfieldformatter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ QStringList QgsValueRelationFieldFormatter::valueToStringList( const QVariant &v
}
}
}
catch ( json::parse_error ex )
catch ( json::parse_error &ex )
{
qDebug() << QString::fromStdString( ex.what() );
}
Expand All @@ -210,6 +210,7 @@ QStringList QgsValueRelationFieldFormatter::valueToStringList( const QVariant &v
else if ( value.type() == QVariant::List )
{
QVariantList valuesList( value.toList( ) );
checkList.reserve( valuesList.size() );
for ( const QVariant &listItem : qgis::as_const( valuesList ) )
{
QString v( listItem.toString( ) );
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsjsonutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ QVariantList QgsJsonUtils::parseArray( const QString &json, QVariant::Type type
}
}
}
catch ( json::parse_error ex )
catch ( json::parse_error &ex )
{
errorMessage = ex.what();
QgsLogger::warning( QStringLiteral( "Cannot parse json (%1): %2" ).arg( ex.what(), json ) );
Expand Down
2 changes: 1 addition & 1 deletion src/providers/spatialite/qgsspatialiteprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4418,7 +4418,7 @@ bool QgsSpatiaLiteProvider::changeAttributeValues( const QgsChangedAttributesMap
jRepr = QString::fromStdString( jObj.dump( ) );
sql += QStringLiteral( "%1=%2" ).arg( QgsSqliteUtils::quotedIdentifier( fld.name() ), QgsSqliteUtils::quotedString( jRepr ) );
}
catch ( json::exception ex )
catch ( json::exception &ex )
{
const auto errM { tr( "Field type is JSON but the value cannot be converted to JSON array: %1" ).arg( ex.what() ) };
auto msgPtr { static_cast<char *>( sqlite3_malloc( errM.length() + 1 ) ) };
Expand Down

0 comments on commit 76d9a26

Please sign in to comment.