Add some comments and logging

This commit is contained in:
Henrik Rydgård 2024-01-22 10:08:50 +01:00
parent 902eed59bb
commit bd388fc094
2 changed files with 5 additions and 2 deletions

View File

@ -134,7 +134,6 @@ void GameManager::UninstallGame(const std::string &name) {
AndroidJNIThreadContext context; // Destructor detaches.
Path gameDir = GetSysDirectory(DIRECTORY_GAME) / name;
auto st = GetI18NCategory(I18NCat::STORE);
INFO_LOG(HLE, "Uninstalling '%s'", gameDir.c_str());

View File

@ -74,6 +74,7 @@ bool GameInfo::Delete() {
{
// Just delete the one file (TODO: handle two-disk games as well somehow).
Path fileToRemove = filePath_;
INFO_LOG(SYSTEM, "Deleting file %s", fileToRemove.c_str());
File::Delete(fileToRemove);
g_Config.RemoveRecent(filePath_.ToString());
return true;
@ -83,7 +84,7 @@ bool GameInfo::Delete() {
{
// TODO: This could be handled by Core/Util/GameManager too somehow.
Path directoryToRemove = ResolvePBPDirectory(filePath_);
INFO_LOG(SYSTEM, "Deleting %s", directoryToRemove.c_str());
INFO_LOG(SYSTEM, "Deleting directory %s", directoryToRemove.c_str());
if (!File::DeleteDirRecursively(directoryToRemove)) {
ERROR_LOG(SYSTEM, "Failed to delete file");
return false;
@ -101,6 +102,7 @@ bool GameInfo::Delete() {
case IdentifiedFileType::PPSSPP_GE_DUMP:
{
const Path &fileToRemove = filePath_;
INFO_LOG(SYSTEM, "Deleting file %s", fileToRemove.c_str());
File::Delete(fileToRemove);
g_Config.RemoveRecent(filePath_.ToString());
return true;
@ -109,6 +111,7 @@ bool GameInfo::Delete() {
case IdentifiedFileType::PPSSPP_SAVESTATE:
{
const Path &ppstPath = filePath_;
INFO_LOG(SYSTEM, "Deleting file %s", ppstPath.c_str());
File::Delete(ppstPath);
const Path screenshotPath = filePath_.WithReplacedExtension(".ppst", ".jpg");
if (File::Exists(screenshotPath)) {
@ -118,6 +121,7 @@ bool GameInfo::Delete() {
}
default:
INFO_LOG(SYSTEM, "Don't know how to delete this type of file: %s", filePath_.c_str());
return false;
}
}