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 | 3df0c826a1eb7e7a0fa8bb9c924667323d1981ce (patch) | |
| tree | 740a2a94eff69f5d20b1e7424f8665acbd950939 /src/frontend_common/content_manager.h | |
| parent | 89e12de5e1b5bbf636cfc5840a262590ad1216f0 (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/content_manager.h')
| -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 8e55f4ca09..248ce573e1 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)>()) { |
