MCPcopy Create free account
hub / github.com/ErrorAtLine0/infinipaint / save_config

Method save_config

src/MainProgram.cpp:197–215  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

195}
196
197void MainProgram::save_config() {
198 using json = nlohmann::json;
199 json j;
200
201 j["version"] = VersionConstants::CURRENT_VERSION_STRING;
202 j["settings"] = conf.get_config_json(input);
203 j["window"]["pos"] = window.writtenPos;
204 j["window"]["size"] = window.writtenSize;
205 j["window"]["maximized"] = window.maximized;
206 j["window"]["fullscreen"] = window.fullscreen;
207 j["fileselectorpath"] = conf.currentSearchPath;
208 j["toolConfig"] = toolConfig;
209
210 std::stringstream f;
211 f << std::setw(4) << j;
212 SDL_SaveFile((conf.configPath / "config.json").string().c_str(), f.view().data(), f.view().size());
213
214 conf.save_palettes();
215}
216
217void MainProgram::load_config() {
218 conf.currentSearchPath = homePath;

Callers 3

emscripten_before_unloadFunction · 0.80
SDL_AppQuitFunction · 0.80

Calls 6

get_config_jsonMethod · 0.80
c_strMethod · 0.80
save_palettesMethod · 0.80
stringMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected