| 64 | } |
| 65 | |
| 66 | void AppData::addRecentPath(std::vector<std::filesystem::path>& paths, const std::filesystem::path& path) |
| 67 | { |
| 68 | if (!std::filesystem::exists(path)) return; |
| 69 | std::filesystem::path fullPath = std::filesystem::canonical(path); |
| 70 | paths.erase(std::remove(paths.begin(), paths.end(), fullPath), paths.end()); |
| 71 | paths.insert(paths.begin(), fullPath); |
| 72 | if (paths.size() > kMaxRecentFiles) paths.resize(kMaxRecentFiles); |
| 73 | save(); |
| 74 | } |
| 75 | |
| 76 | void AppData::removeNonExistingPaths(std::vector<std::filesystem::path>& paths) |
| 77 | { |