diff options
author | t895 <clombardo169@gmail.com> | 2024-01-19 16:37:34 -0500 |
---|---|---|
committer | t895 <clombardo169@gmail.com> | 2024-01-19 20:54:50 -0500 |
commit | 03fa91ba3c52c0371f0d57ea8a5618feaf3012e7 (patch) | |
tree | 740a2a94eff69f5d20b1e7424f8665acbd950939 /src/frontend_common | |
parent | d79d4d5986e952000624edb244839fd1996be4ae (diff) |
android: Add addon delete button
Required some refactoring of retrieving patches in order for the frontend to pass the right information to ContentManager for deletion.
Diffstat (limited to 'src/frontend_common')
-rw-r--r-- | src/frontend_common/content_manager.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/frontend_common/content_manager.h b/src/frontend_common/content_manager.h index 8e55f4ca0..248ce573e 100644 --- a/src/frontend_common/content_manager.h +++ b/src/frontend_common/content_manager.h @@ -65,6 +65,23 @@ inline bool RemoveBaseContent(const Service::FileSystem::FileSystemController& f fs_controller.GetSDMCContents()->RemoveExistingEntry(program_id); } +inline bool RemoveMod(const Service::FileSystem::FileSystemController& fs_controller, + const u64 program_id, const std::string& mod_name) { + // Check general Mods (LayeredFS and IPS) + const auto mod_dir = fs_controller.GetModificationLoadRoot(program_id); + if (mod_dir != nullptr) { + return mod_dir->DeleteSubdirectoryRecursive(mod_name); + } + + // Check SDMC mod directory (RomFS LayeredFS) + const auto sdmc_mod_dir = fs_controller.GetSDMCModificationLoadRoot(program_id); + if (sdmc_mod_dir != nullptr) { + return sdmc_mod_dir->DeleteSubdirectoryRecursive(mod_name); + } + + return false; +} + inline InstallResult InstallNSP( Core::System* system, FileSys::VfsFilesystem* vfs, const std::string& filename, const std::function<bool(size_t, size_t)>& callback = std::function<bool(size_t, size_t)>()) { |