Исправлен баг с utc

pull/71/head
Igor Belitskiy 3 years ago
parent a037d72c0f
commit a24fa2071c

@ -445,10 +445,10 @@ void MainWindow::hardware_clock_global(string &local, string &etc){
void MainWindow::entry_hardware_clock(string &cmd, string &cmd_default){ void MainWindow::entry_hardware_clock(string &cmd, string &cmd_default){
struct Result<string> obj_result = this->wrapper_call(cmd); struct Result<string> obj_result = this->wrapper_call(cmd);
if (obj_result.error == 0){ if (obj_result.error == 0){
if (obj_result.response == "localtime"){ if (obj_result.response.find("localtime")!=string::npos){
cbHw->set_active(0); cbHw->set_active(0);
} }
else if (obj_result.response == "etc"){ else if (obj_result.response.find("utc")!=string::npos){
cbHw->set_active(1); cbHw->set_active(1);
} }
} }
@ -457,19 +457,20 @@ void MainWindow::entry_hardware_clock(string &cmd, string &cmd_default){
cbHw->set_active(-1); cbHw->set_active(-1);
} }
else{ else{
struct Result<string> obj_result = this->wrapper_call(cmd_default); struct Result<string> obj_result_default = this->wrapper_call(cmd_default);
if (obj_result.error == 0){ if (obj_result_default.error == 0){
if (obj_result.response == "localtime"){ if (obj_result_default.response.find("localtime")!=string::npos){
cbHw->set_active(0); cbHw->set_active(0);
} }
else if (obj_result.response == "etc"){ else if (obj_result_default.response.find("utc")!=string::npos){
cbHw->set_active(1); cbHw->set_active(1);
} }
} }
else if (obj_result.error == 3){ else if (obj_result_default.error == 3){
warning_info-=1; warning_info-=1;
cbHw->set_active(-1); cbHw->set_active(-1);
} }
} }
} }

Loading…
Cancel
Save