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

Method FileSelectScreen

src/Screens/FileSelectScreen.cpp:50–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48#define MAIN_SAVES_FOLDER_STR "saves"
49
50FileSelectScreen::FileSelectScreen(MainProgram& m): Screen(m) {
51 savePath = main.conf.configPath / MAIN_SAVES_FOLDER_STR;
52 trashPath = main.conf.configPath / "trash";
53 infoPath = main.conf.configPath / "fileSelectInfo.json";
54
55 SDL_CreateDirectory(savePath.string().c_str());
56 SDL_CreateDirectory(trashPath.string().c_str());
57
58 try {
59 nlohmann::json j(nlohmann::json::parse(read_file_to_string(infoPath)));
60 j.get_to(saveInfo);
61 }
62 catch(...) {}
63
64 update_file_list(fileList, savePath, false);
65
66 // Update trash list once to get trash info up to date
67 std::vector<FileInfo> trashListTemp;
68 update_file_list(trashListTemp, trashPath, true);
69}
70
71void FileSelectScreen::update() {
72 std::erase_if(main.logMessages, [&](auto& logM) {

Callers

nothing calls this directly

Calls 5

parseFunction · 0.85
read_file_to_stringFunction · 0.85
c_strMethod · 0.80
get_toMethod · 0.80
stringMethod · 0.45

Tested by

no test coverage detected