opti:优化提示错误。
This commit is contained in:
parent
aa6481cea4
commit
9b100aa19e
@ -261,7 +261,10 @@ void MainWidget::judge_btn_page()
|
|||||||
|
|
||||||
void MainWidget::read(const QString& file_path)
|
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);
|
ui->edStatus->setText(file_path);
|
||||||
|
|
||||||
if (!xml_.open(base_.xml_path)) {
|
if (!xml_.open(base_.xml_path)) {
|
||||||
|
@ -19,13 +19,16 @@ bool ConfigIni::set_work_exe(const std::string& dir)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigIni::set_xml_path(const std::string& path)
|
bool ConfigIni::set_xml_path(const std::string& path)
|
||||||
{
|
{
|
||||||
if (ini_.IsEmpty()) {
|
if (ini_.IsEmpty()) {
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
ini_.SetValue("Basic", "xml_path", path.c_str());
|
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()
|
OprBase ConfigIni::get_config()
|
||||||
|
@ -20,7 +20,7 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
bool set_work_exe(const std::string& dir);
|
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();
|
OprBase get_config();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user