mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-27 23:37:05 -05:00
fix: File provider not erroring out correctly when selecting a folder to open
This commit is contained in:
@@ -443,6 +443,7 @@
|
||||
"hex.builtin.provider.file": "Regular File",
|
||||
"hex.builtin.provider.file.error.open": "Failed to open file {}: {}",
|
||||
"hex.builtin.provider.file.error.already_open": "Same file is already open",
|
||||
"hex.builtin.provider.file.error.is_directory": "Selected entry '{}' is a directory",
|
||||
"hex.builtin.provider.file.access": "Last access time",
|
||||
"hex.builtin.provider.file.creation": "Creation time",
|
||||
"hex.builtin.provider.file.menu.direct_access": "Direct access file",
|
||||
|
||||
@@ -235,6 +235,9 @@ namespace hex::plugin::builtin {
|
||||
m_readable = true;
|
||||
m_writable = true;
|
||||
|
||||
if (wolv::io::fs::isDirectory(m_path))
|
||||
return OpenResult::failure(fmt::format("hex.builtin.provider.file.error.is_directory"_lang, m_path.string()));
|
||||
|
||||
wolv::io::File file(m_path, wolv::io::File::Mode::Write);
|
||||
if (!file.isValid()) {
|
||||
m_writable = false;
|
||||
|
||||
Reference in New Issue
Block a user