If you pass a valid path to a 'zep.cfg' file, then editor settings will serialize from that You can even edit it inside zep for immediate changes :)
| 135 | // If you pass a valid path to a 'zep.cfg' file, then editor settings will serialize from that |
| 136 | // You can even edit it inside zep for immediate changes :) |
| 137 | void ZepEditor::LoadConfig(const fs::path& config_path) { |
| 138 | if (!GetFileSystem().Exists(config_path)) { |
| 139 | return; |
| 140 | } |
| 141 | |
| 142 | try { |
| 143 | std::shared_ptr<cpptoml::table> spConfig; |
| 144 | spConfig = cpptoml::parse_file(config_path.string()); |
| 145 | if (spConfig == nullptr) |
| 146 | return; |
| 147 | |
| 148 | LoadConfig(spConfig); |
| 149 | } catch (cpptoml::parse_exception& ex) { |
| 150 | std::ostringstream str; |
| 151 | str << config_path.filename().string() << " : Failed to parse. " << ex.what(); |
| 152 | SetCommandText(str.str()); |
| 153 | } catch (...) { |
| 154 | std::ostringstream str; |
| 155 | str << config_path.filename().string() << " : Failed to parse. "; |
| 156 | SetCommandText(str.str()); |
| 157 | } |
| 158 | } |
| 159 | |
| 160 | void ZepEditor::LoadConfig(std::shared_ptr<cpptoml::table> spConfig) { |
| 161 | try { |
nothing calls this directly
no test coverage detected