diff options
| author | 2024-01-19 16:37:34 -0500 | |
|---|---|---|
| committer | 2024-01-19 20:54:50 -0500 | |
| commit | 03fa91ba3c52c0371f0d57ea8a5618feaf3012e7 (patch) | |
| tree | 740a2a94eff69f5d20b1e7424f8665acbd950939 /src/frontend_common/content_manager.h | |
| parent | android: Use callback to update progress bar dialogs (diff) | |
| download | yuzu-03fa91ba3c52c0371f0d57ea8a5618feaf3012e7.tar.gz yuzu-03fa91ba3c52c0371f0d57ea8a5618feaf3012e7.tar.xz yuzu-03fa91ba3c52c0371f0d57ea8a5618feaf3012e7.zip | |
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 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 | |||
| 65 | fs_controller.GetSDMCContents()->RemoveExistingEntry(program_id); | 65 | fs_controller.GetSDMCContents()->RemoveExistingEntry(program_id); |
| 66 | } | 66 | } |
| 67 | 67 | ||
| 68 | inline bool RemoveMod(const Service::FileSystem::FileSystemController& fs_controller, | ||
| 69 | const u64 program_id, const std::string& mod_name) { | ||
| 70 | // Check general Mods (LayeredFS and IPS) | ||
| 71 | const auto mod_dir = fs_controller.GetModificationLoadRoot(program_id); | ||
| 72 | if (mod_dir != nullptr) { | ||
| 73 | return mod_dir->DeleteSubdirectoryRecursive(mod_name); | ||
| 74 | } | ||
| 75 | |||
| 76 | // Check SDMC mod directory (RomFS LayeredFS) | ||
| 77 | const auto sdmc_mod_dir = fs_controller.GetSDMCModificationLoadRoot(program_id); | ||
| 78 | if (sdmc_mod_dir != nullptr) { | ||
| 79 | return sdmc_mod_dir->DeleteSubdirectoryRecursive(mod_name); | ||
| 80 | } | ||
| 81 | |||
| 82 | return false; | ||
| 83 | } | ||
| 84 | |||
| 68 | inline InstallResult InstallNSP( | 85 | inline InstallResult InstallNSP( |
| 69 | Core::System* system, FileSys::VfsFilesystem* vfs, const std::string& filename, | 86 | Core::System* system, FileSys::VfsFilesystem* vfs, const std::string& filename, |
| 70 | const std::function<bool(size_t, size_t)>& callback = std::function<bool(size_t, size_t)>()) { | 87 | const std::function<bool(size_t, size_t)>& callback = std::function<bool(size_t, size_t)>()) { |