Qtification "lite" - first round

This commit is contained in:
miodragpop
2020-06-15 13:11:39 +02:00
parent efa216a131
commit e20efde2ed
29 changed files with 859 additions and 19772 deletions

View File

@@ -4,8 +4,6 @@
#include "precompiled.h"
#include "camount.h"
using json = nlohmann::json;
struct Config {
QString server;
};
@@ -67,8 +65,6 @@ public:
void set_currency_name(QString currency_name);
bool isSaplingActive();
void setZECPrice(double p) { ZECPrice = p; }
@@ -225,13 +221,12 @@ private:
};
inline bool isJsonResultSuccess(const json& res) {
return res.find("result") != res.end() &&
QString::fromStdString(res["result"].get<json::string_t>()) == "success";
inline bool isJsonResultSuccess(const QJsonValue& res) {
return res.toObject()["result"].toString() == "success";
}
inline bool isJsonError(const json& res) {
return res.find("error") != res.end();
inline bool isJsonError(const QJsonValue& res) {
return !res.toObject()["error"].isNull();
}