opti:优化提示错误。

This commit is contained in:
taynpg 2024-05-20 07:58:51 +08:00
parent aa6481cea4
commit 9b100aa19e
3 changed files with 11 additions and 5 deletions

View File

@ -261,7 +261,10 @@ void MainWidget::judge_btn_page()
void MainWidget::read(const QString& file_path)
{
ini_.set_xml_path(file_path.toStdString());
if (!ini_.set_xml_path(file_path.toStdString())) {
CUtil::msg(this, u8"没有ini配置文件或者保存ini失败。");
return;
}
ui->edStatus->setText(file_path);
if (!xml_.open(base_.xml_path)) {

View File

@ -19,13 +19,16 @@ bool ConfigIni::set_work_exe(const std::string& dir)
return true;
}
void ConfigIni::set_xml_path(const std::string& path)
bool ConfigIni::set_xml_path(const std::string& path)
{
if (ini_.IsEmpty()) {
return;
return false;
}
ini_.SetValue("Basic", "xml_path", path.c_str());
ini_.SaveFile(ini_path_.c_str());
if (!ini_.SaveFile(ini_path_.c_str()) != SI_OK) {
return false;
}
return true;
}
OprBase ConfigIni::get_config()

View File

@ -20,7 +20,7 @@ public:
public:
bool set_work_exe(const std::string& dir);
void set_xml_path(const std::string& path);
bool set_xml_path(const std::string& path);
OprBase get_config();
private: