From 72645aa8001264ddcba20b6720f653ea293adc4f Mon Sep 17 00:00:00 2001 From: WerWolv Date: Tue, 27 Feb 2024 20:20:14 +0100 Subject: [PATCH] fix: Read-only file toast showing up for all providers --- plugins/builtin/source/content/events.cpp | 3 --- plugins/builtin/source/content/providers/file_provider.cpp | 7 +++++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/builtin/source/content/events.cpp b/plugins/builtin/source/content/events.cpp index c10e05886..af9eadee5 100644 --- a/plugins/builtin/source/content/events.cpp +++ b/plugins/builtin/source/content/events.cpp @@ -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); } }); diff --git a/plugins/builtin/source/content/providers/file_provider.cpp b/plugins/builtin/source/content/providers/file_provider.cpp index 894dd5aba..4d1b6b243 100644 --- a/plugins/builtin/source/content/providers/file_provider.cpp +++ b/plugins/builtin/source/content/providers/file_provider.cpp @@ -1,13 +1,13 @@ #include "content/providers/file_provider.hpp" #include "content/providers/memory_file_provider.hpp" -#include - #include #include #include #include +#include + #include #include #include @@ -15,6 +15,7 @@ #include #include +#include #if defined(OS_WINDOWS) #include @@ -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);