1
0
mirror of synced 2024-11-28 09:30:51 +01:00

fix: Read-only file toast showing up for all providers

This commit is contained in:
WerWolv 2024-02-27 20:20:14 +01:00
parent 7044fc8004
commit 72645aa800
2 changed files with 5 additions and 5 deletions

View File

@ -99,9 +99,6 @@ namespace hex::plugin::builtin {
EventProviderOpened::subscribe([](hex::prv::Provider *provider) {
if (provider != nullptr && ImHexApi::Provider::get() == provider) {
RequestUpdateWindowTitle::post();
if (!provider->isWritable())
ui::ToastInfo::open("hex.builtin.popup.error.read_only"_lang);
}
});

View File

@ -1,13 +1,13 @@
#include "content/providers/file_provider.hpp"
#include "content/providers/memory_file_provider.hpp"
#include <cstring>
#include <hex/api/imhex_api.hpp>
#include <hex/api/localization_manager.hpp>
#include <hex/api/project_file_manager.hpp>
#include <hex/api/task_manager.hpp>
#include <toasts/toast_notification.hpp>
#include <hex/helpers/utils.hpp>
#include <hex/helpers/fmt.hpp>
#include <fmt/chrono.h>
@ -15,6 +15,7 @@
#include <wolv/utils/string.hpp>
#include <nlohmann/json.hpp>
#include <cstring>
#if defined(OS_WINDOWS)
#include <windows.h>
@ -222,6 +223,8 @@ namespace hex::plugin::builtin {
this->setErrorMessage(hex::format("hex.builtin.provider.file.error.open"_lang, m_path.string(), ::strerror(errno)));
return false;
}
ui::ToastInfo::open("hex.builtin.popup.error.read_only"_lang);
}
m_file = std::move(file);