ux: Automatically remove recently opened file entries if the file doesn't exist anymore

This commit is contained in:
WerWolv
2022-03-26 16:34:29 +01:00
parent 591d98b55b
commit 1c53d2c123

View File

@@ -468,8 +468,11 @@ namespace hex::plugin::builtin {
}
}
for (const auto &path : ContentRegistry::Settings::read("hex.builtin.setting.imhex", "hex.builtin.setting.imhex.recent_files"))
s_recentFilePaths.emplace_back(std::u8string(path.begin(), path.end()));
for (const auto &pathString : ContentRegistry::Settings::read("hex.builtin.setting.imhex", "hex.builtin.setting.imhex.recent_files")) {
std::fs::path path = std::u8string(pathString.begin(), pathString.end());
if (fs::exists(path))
s_recentFilePaths.emplace_back(path);
}
if (ImHexApi::System::getInitArguments().contains("tip-of-the-day")) {
s_tipOfTheDay = ImHexApi::System::getInitArguments()["tip-of-the-day"];