mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-10-07 07:41:06 +00:00
Fix AppConfig text persistence and section-specific boolean reads (#16092)
This commit is contained in:
@@ -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 §ion, 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 §ion, 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){
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user