diff -r af3dac6ff6c3 -r d1d208a857b0 src/database/db_recipe.cpp --- a/src/database/db_recipe.cpp Mon Jun 13 12:26:27 2022 +0200 +++ b/src/database/db_recipe.cpp Mon Jun 13 15:47:16 2022 +0200 @@ -193,22 +193,22 @@ for (int i = 0; i < hops.array().size(); i++) { QJsonObject obj = hops.array().at(i).toObject(); Hops h; - h.h_name = obj["h_name"].toString(); - h.h_origin = obj["h_origin"].toString(); - h.h_amount = obj["h_amount"].toDouble(); - h.h_cost = obj["h_cost"].toDouble(); - h.h_type = obj["h_type"].toInt(); - h.h_form = obj["h_form"].toInt(); - h.h_useat = obj["h_useat"].toInt(); - h.h_time = obj["h_time"].toInt(); - h.h_alpha = obj["h_alpha"].toDouble(); - h.h_beta = obj["h_beta"].toDouble(); - h.h_hsi = obj["h_hsi"].toDouble(); - h.h_humulene = obj["h_humulene"].toDouble(); - h.h_caryophyllene = obj["h_caryophyllene"].toDouble(); - h.h_cohumulone = obj["h_cohumulone"].toDouble(); - h.h_myrcene = obj["h_myrcene"].toDouble(); - h.h_total_oil = obj["h_total_oil"].toDouble(); + h.name = obj["h_name"].toString(); + h.origin = obj["h_origin"].toString(); + h.amount = obj["h_amount"].toDouble(); + h.cost = obj["h_cost"].toDouble(); + h.type = obj["h_type"].toInt(); + h.form = obj["h_form"].toInt(); + h.useat = obj["h_useat"].toInt(); + h.time = obj["h_time"].toInt(); + h.alpha = obj["h_alpha"].toDouble(); + h.beta = obj["h_beta"].toDouble(); + h.hsi = obj["h_hsi"].toDouble(); + h.humulene = obj["h_humulene"].toDouble(); + h.caryophyllene = obj["h_caryophyllene"].toDouble(); + h.cohumulone = obj["h_cohumulone"].toDouble(); + h.myrcene = obj["h_myrcene"].toDouble(); + h.total_oil = obj["h_total_oil"].toDouble(); reci->hops.append(h); } } @@ -520,22 +520,22 @@ QJsonArray array; for (int i = 0; i < reci->hops.size(); i++) { QJsonObject obj; - obj.insert("h_name", reci->hops.at(i).h_name); - obj.insert("h_origin", reci->hops.at(i).h_origin); - obj.insert("h_amount", round(reci->hops.at(i).h_amount * 10000) / 10000); - obj.insert("h_cost", round(reci->hops.at(i).h_cost * 100) / 100); - obj.insert("h_type", reci->hops.at(i).h_type); - obj.insert("h_form", reci->hops.at(i).h_form); - obj.insert("h_useat", reci->hops.at(i).h_useat); - obj.insert("h_time", round(reci->hops.at(i).h_time)); - obj.insert("h_alpha", round(reci->hops.at(i).h_alpha * 100) / 100); - obj.insert("h_beta", round(reci->hops.at(i).h_beta * 100) / 100); - obj.insert("h_hsi", round(reci->hops.at(i).h_hsi * 100) / 100); - obj.insert("h_humulene", round(reci->hops.at(i).h_humulene * 100) / 100); - obj.insert("h_caryophyllene", round(reci->hops.at(i).h_caryophyllene * 100) / 100); - obj.insert("h_cohumulone", round(reci->hops.at(i).h_cohumulone * 100) / 100); - obj.insert("h_myrcene", round(reci->hops.at(i).h_myrcene * 100) / 100); - obj.insert("h_total_oil", round(reci->hops.at(i).h_total_oil * 100) / 100); + obj.insert("h_name", reci->hops.at(i).name); + obj.insert("h_origin", reci->hops.at(i).origin); + obj.insert("h_amount", round(reci->hops.at(i).amount * 10000) / 10000); + obj.insert("h_cost", round(reci->hops.at(i).cost * 100) / 100); + obj.insert("h_type", reci->hops.at(i).type); + obj.insert("h_form", reci->hops.at(i).form); + obj.insert("h_useat", reci->hops.at(i).useat); + obj.insert("h_time", round(reci->hops.at(i).time)); + obj.insert("h_alpha", round(reci->hops.at(i).alpha * 100) / 100); + obj.insert("h_beta", round(reci->hops.at(i).beta * 100) / 100); + obj.insert("h_hsi", round(reci->hops.at(i).hsi * 100) / 100); + obj.insert("h_humulene", round(reci->hops.at(i).humulene * 100) / 100); + obj.insert("h_caryophyllene", round(reci->hops.at(i).caryophyllene * 100) / 100); + obj.insert("h_cohumulone", round(reci->hops.at(i).cohumulone * 100) / 100); + obj.insert("h_myrcene", round(reci->hops.at(i).myrcene * 100) / 100); + obj.insert("h_total_oil", round(reci->hops.at(i).total_oil * 100) / 100); array.append(obj); /* Append this object */ } QJsonDocument doc;