mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-28 07:47:03 -05:00
fix: ImHex failing to load in Portable mode from a folder with no permissions
Fixes #881
This commit is contained in:
@@ -474,12 +474,15 @@ namespace hex::plugin::builtin {
|
|||||||
|
|
||||||
(void)EventManager::subscribe<EventProviderOpened>([](prv::Provider *provider) {
|
(void)EventManager::subscribe<EventProviderOpened>([](prv::Provider *provider) {
|
||||||
{
|
{
|
||||||
auto recentPath = fs::getDefaultPaths(fs::ImHexPath::Recent).front();
|
for (const auto &recentPath : fs::getDefaultPaths(fs::ImHexPath::Recent)) {
|
||||||
auto fileName = hex::format("{:%y%m%d_%H%M%S}.json", fmt::gmtime(std::chrono::system_clock::now()));
|
auto fileName = hex::format("{:%y%m%d_%H%M%S}.json", fmt::gmtime(std::chrono::system_clock::now()));
|
||||||
fs::File recentFile(recentPath / fileName, fs::File::Mode::Create);
|
fs::File recentFile(recentPath / fileName, fs::File::Mode::Create);
|
||||||
|
if (!recentFile.isValid())
|
||||||
|
continue;
|
||||||
|
|
||||||
if (auto settings = provider->storeSettings(); !settings.is_null())
|
if (auto settings = provider->storeSettings(); !settings.is_null())
|
||||||
recentFile.write(settings.dump(4));
|
recentFile.write(settings.dump(4));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
updateRecentProviders();
|
updateRecentProviders();
|
||||||
|
|||||||
Reference in New Issue
Block a user