mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 13:37:42 -05:00
@@ -1,6 +1,8 @@
|
||||
#include <hex/api/content_registry.hpp>
|
||||
|
||||
#include <hex/api/project_file_manager.hpp>
|
||||
|
||||
#include <hex/helpers/default_paths.hpp>
|
||||
|
||||
#include <toasts/toast_notification.hpp>
|
||||
|
||||
namespace hex::plugin::builtin {
|
||||
@@ -12,7 +14,7 @@ namespace hex::plugin::builtin {
|
||||
});
|
||||
|
||||
ContentRegistry::FileHandler::add({ ".hexlyt" }, [](const std::fs::path &path) {
|
||||
for (const auto &folder : fs::getDefaultPaths(fs::ImHexPath::Layouts)) {
|
||||
for (const auto &folder : paths::Layouts.write()) {
|
||||
if (wolv::io::fs::copyFile(path, folder / path.filename()))
|
||||
return true;
|
||||
}
|
||||
@@ -21,7 +23,7 @@ namespace hex::plugin::builtin {
|
||||
});
|
||||
|
||||
ContentRegistry::FileHandler::add({ ".mgc" }, [](const auto &path) {
|
||||
for (const auto &destPath : fs::getDefaultPaths(fs::ImHexPath::Magic)) {
|
||||
for (const auto &destPath : paths::Magic.write()) {
|
||||
if (wolv::io::fs::copyFile(path, destPath / path.filename(), std::fs::copy_options::overwrite_existing)) {
|
||||
ui::ToastInfo::open("hex.builtin.view.information.magic_db_added"_lang);
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user