From ee22373c4d9a0bd5ccfb43e63f4295aab05f1f9b Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Sun, 18 Sep 2016 20:11:46 -0700 Subject: [PATCH] Missing const, plus log output bug fix --- src/JsonHelper.cc | 4 ++-- src/JsonHelper.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/JsonHelper.cc b/src/JsonHelper.cc index 25ae0f5b6..9a8bd14df 100644 --- a/src/JsonHelper.cc +++ b/src/JsonHelper.cc @@ -101,13 +101,13 @@ bool JsonHelper::validateKeyTypes(const QJsonObject& jsonObject, const QStringLi return true; } -bool JsonHelper::parseEnum(QJsonObject& jsonObject, QStringList& enumStrings, QStringList& enumValues, QString& errorString) +bool JsonHelper::parseEnum(const QJsonObject& jsonObject, QStringList& enumStrings, QStringList& enumValues, QString& errorString) { enumStrings = jsonObject.value(_enumStringsJsonKey).toString().split(",", QString::SkipEmptyParts); enumValues = jsonObject.value(_enumValuesJsonKey).toString().split(",", QString::SkipEmptyParts); if (enumStrings.count() != enumValues.count()) { - errorString = QString("enum strings/values count mismatch: %1"); + errorString = QString("enum strings/values count mismatch strings:values %1:%2").arg(enumStrings.count()).arg(enumValues.count()); return false; } diff --git a/src/JsonHelper.h b/src/JsonHelper.h index adc37658c..1a01b05d9 100644 --- a/src/JsonHelper.h +++ b/src/JsonHelper.h @@ -24,7 +24,7 @@ public: static bool validateRequiredKeys(const QJsonObject& jsonObject, const QStringList& keys, QString& errorString); static bool validateKeyTypes(const QJsonObject& jsonObject, const QStringList& keys, const QList& types, QString& errorString); static bool toQGeoCoordinate(const QJsonValue& jsonValue, QGeoCoordinate& coordinate, bool altitudeRequired, QString& errorString); - static bool parseEnum(QJsonObject& jsonObject, QStringList& enumStrings, QStringList& enumValues, QString& errorString); + static bool parseEnum(const QJsonObject& jsonObject, QStringList& enumStrings, QStringList& enumValues, QString& errorString); static void writeQGeoCoordinate(QJsonValue& jsonValue, const QGeoCoordinate& coordinate, bool writeAltitude); -- 2.22.0