1
0
mirror of synced 2024-11-14 19:17:42 +01:00

fix: Opening project files through the command line opening them as regular files

This commit is contained in:
WerWolv 2024-02-26 21:43:28 +01:00
parent 25cfa6f10b
commit 976baec753

View File

@ -25,6 +25,13 @@
namespace hex::plugin::builtin {
static void openFile(const std::fs::path &path) {
if (path.extension() == ".hexproj") {
if (!ProjectFile::load(path)) {
ui::ToastError::open(hex::format("hex.builtin.popup.error.project.load"_lang, wolv::util::toUTF8String(path)));
}
return;
}
auto provider = ImHexApi::Provider::createProvider("hex.builtin.provider.file", true);
if (auto *fileProvider = dynamic_cast<FileProvider*>(provider); fileProvider != nullptr) {
fileProvider->setPath(path);