Skip to content

Commit ca3fa1c

Browse files
authored
fix simple json (#179)
1 parent 572dc10 commit ca3fa1c

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

gui/davis_gui.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const double OPACITY_IF_NOT_ACTIVE = 0.94;
3737

3838
DavisGUI::DavisGUI(QWidget *parent)
3939
: QMainWindow(parent), ui(new Ui::DavisGUI) {
40-
jsn::getJsonArrayFromFile(":/keys.json", service_json_keys);
40+
jsn::getJsonArrayFromFile("keys.json", service_json_keys);
4141
ui->setupUi(this);
4242
isAboutWindowShowed = false;
4343
m_isMinStyleWindow = false;
@@ -289,15 +289,15 @@ void DavisGUI::readJsonToPlot(const QString &pathToFile) {
289289

290290
if (jsn::getJsonObjectFromFile("user_keys_list.json", user_stamp_keys) ==
291291
false) {
292-
jsn::getJsonObjectFromFile(":/user_keys_list.json", user_stamp_keys);
292+
jsn::getJsonObjectFromFile(":/res/4restore/user_keys_list.json", user_stamp_keys);
293293
}
294294

295295
if (user_stamp_keys.keys().contains("matrix_to_matrix")) {
296296
matrix_to_matrix_stamps =
297297
user_stamp_keys.value("matrix_to_matrix").toArray();
298298
} else {
299299
QJsonObject user_stamp_keys;
300-
jsn::getJsonObjectFromFile(":/user_keys_list.json", user_stamp_keys);
300+
jsn::getJsonObjectFromFile(":/res/4restore/user_keys_list.json", user_stamp_keys);
301301
matrix_to_matrix_stamps =
302302
user_stamp_keys.value("matrix_to_matrix").toArray();
303303
}
@@ -309,7 +309,9 @@ void DavisGUI::readJsonToPlot(const QString &pathToFile) {
309309
return;
310310
};
311311
jsn::extractAllObjects(jv, result);
312-
// qDebug()<<"result all objects size:"<<result.size();
312+
//qDebug()<<"result all objects size:"<<result.size()<<jv;
313+
//qDebug()<<"service_json_keys: "<<service_json_keys;
314+
//qDebug()<<"user_stamp_keys: "<<user_stamp_keys;
313315

314316
for (int i = 0; i < result.size(); ++i) {
315317

gui/json_utils.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,13 @@ isJsonObjectContainsUserKeys(const QJsonObject &user_json_from_file,
8686
QStringList user_stamp_keys_list = user_stamp_keys.keys();
8787

8888
// Check that all user stamp keys are valid
89-
for (int i = 0; i < user_stamp_keys_list.size(); ++i) {
89+
/*for (int i = 0; i < user_stamp_keys_list.size(); ++i) {
9090
QString check_key = user_stamp_keys_list[i];
9191
if (service_keys.contains(QJsonValue(check_key)) == false) {
9292
qDebug() << "invalid key in the user stamps json" << check_key;
9393
return {false, QJsonObject()};
9494
}
95-
}
95+
}*/
9696

9797
// Check that we have keys for user json
9898
for (int i = 0; i < service_keys.size(); ++i) {

0 commit comments

Comments
 (0)