diff options
author | liamwhite <liamwhite@users.noreply.github.com> | 2023-05-28 19:17:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-28 19:17:33 +0200 |
commit | 18595738fd79ccf8572ed160c6c0d7681167364e (patch) | |
tree | cfe5e0fa637a01e31b78b663761cc915513cf42b /src/yuzu/main.cpp | |
parent | Merge pull request #10469 from Kelebek1/bc_state (diff) | |
parent | qt: add menu item to remove cache storage (diff) | |
download | yuzu-18595738fd79ccf8572ed160c6c0d7681167364e.tar yuzu-18595738fd79ccf8572ed160c6c0d7681167364e.tar.gz yuzu-18595738fd79ccf8572ed160c6c0d7681167364e.tar.bz2 yuzu-18595738fd79ccf8572ed160c6c0d7681167364e.tar.lz yuzu-18595738fd79ccf8572ed160c6c0d7681167364e.tar.xz yuzu-18595738fd79ccf8572ed160c6c0d7681167364e.tar.zst yuzu-18595738fd79ccf8572ed160c6c0d7681167364e.zip |
Diffstat (limited to 'src/yuzu/main.cpp')
-rw-r--r-- | src/yuzu/main.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 4489f43af..25cfef6d5 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -2323,6 +2323,8 @@ void GMainWindow::OnGameListRemoveFile(u64 program_id, GameListRemoveTarget targ return tr("Delete All Transferable Shader Caches?"); case GameListRemoveTarget::CustomConfiguration: return tr("Remove Custom Game Configuration?"); + case GameListRemoveTarget::CacheStorage: + return tr("Remove Cache Storage?"); default: return QString{}; } @@ -2346,6 +2348,9 @@ void GMainWindow::OnGameListRemoveFile(u64 program_id, GameListRemoveTarget targ case GameListRemoveTarget::CustomConfiguration: RemoveCustomConfiguration(program_id, game_path); break; + case GameListRemoveTarget::CacheStorage: + RemoveCacheStorage(program_id); + break; } } @@ -2435,6 +2440,21 @@ void GMainWindow::RemoveCustomConfiguration(u64 program_id, const std::string& g } } +void GMainWindow::RemoveCacheStorage(u64 program_id) { + const auto nand_dir = Common::FS::GetYuzuPath(Common::FS::YuzuPath::NANDDir); + auto vfs_nand_dir = + vfs->OpenDirectory(Common::FS::PathToUTF8String(nand_dir), FileSys::Mode::Read); + + const auto cache_storage_path = FileSys::SaveDataFactory::GetFullPath( + *system, vfs_nand_dir, FileSys::SaveDataSpaceId::NandUser, + FileSys::SaveDataType::CacheStorage, 0 /* program_id */, {}, 0); + + const auto path = Common::FS::ConcatPathSafe(nand_dir, cache_storage_path); + + // Not an error if it wasn't cleared. + Common::FS::RemoveDirRecursively(path); +} + void GMainWindow::OnGameListDumpRomFS(u64 program_id, const std::string& game_path, DumpRomFSTarget target) { const auto failed = [this] { |