Fix AppConfig text persistence and section-specific boolean reads (#16092)

This commit is contained in:
TheLegendTubaGuy
2026-10-03 20:27:44 -03:00
committed by GitHub
parent 5e2d8ab4f0
commit 32b1e69fdd
4 changed files with 30 additions and 3 deletions
+4 -1
View File
@@ -163,7 +163,7 @@ public:
std::string get(const std::string &key) const
{ std::string value; this->get("app", key, value); return value; }
bool get_bool(const std::string &section, const std::string &key) const
{ return this->get(section, key) == "true" || this->get(key) == "1"; }
{ const std::string value = this->get(section, key); return value == "true" || value == "1"; }
bool get_bool(const std::string &key) const
{ return this->get_bool("app", key); }
void set(const std::string &section, const std::string &key, const std::string &value)
@@ -200,6 +200,9 @@ public:
}
}
void set(const std::string& section, const std::string& key, const char* value)
{ this->set(section, key, std::string(value)); }
void set(const std::string& section, const std::string &key, bool value)
{
if (value){
+1 -1
View File
@@ -835,7 +835,7 @@ int GuideFrame::SaveProfile()
m_MainPtr->app_config->set_bool("stealth_mode", StealthMode);
//finish
m_MainPtr->app_config->set(std::string(m_SectionName.mb_str()), "finish", "1");
m_MainPtr->app_config->set(std::string(m_SectionName.mb_str()), "finish", true);
m_MainPtr->app_config->save();