mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-31 01:59:52 -06:00
Merge pull request #6281 from JosJuice/unify-gamelist-code
Unify ISOFile (wx) with GameFile (Qt) and put it in UICommon
This commit is contained in:
@ -160,6 +160,28 @@ bool InstallWAD(const std::string& wad_path)
|
||||
return InstallWAD(ios, DiscIO::WiiWAD{wad_path}, InstallType::Permanent);
|
||||
}
|
||||
|
||||
bool UninstallTitle(u64 title_id)
|
||||
{
|
||||
IOS::HLE::Kernel ios;
|
||||
return ios.GetES()->DeleteTitleContent(title_id) == IOS::HLE::IPC_SUCCESS;
|
||||
}
|
||||
|
||||
bool IsTitleInstalled(u64 title_id)
|
||||
{
|
||||
const std::string content_dir =
|
||||
Common::GetTitleContentPath(title_id, Common::FromWhichRoot::FROM_CONFIGURED_ROOT);
|
||||
|
||||
if (!File::IsDirectory(content_dir))
|
||||
return false;
|
||||
|
||||
// Since this isn't IOS and we only need a simple way to figure out if a title is installed,
|
||||
// we make the (reasonable) assumption that having more than just the TMD in the content
|
||||
// directory means that the title is installed.
|
||||
const auto entries = File::ScanDirectoryTree(content_dir, false);
|
||||
return std::any_of(entries.children.begin(), entries.children.end(),
|
||||
[](const auto& file) { return file.virtualName != "title.tmd"; });
|
||||
}
|
||||
|
||||
// Common functionality for system updaters.
|
||||
class SystemUpdater
|
||||
{
|
||||
|
@ -38,6 +38,10 @@ bool InstallWAD(IOS::HLE::Kernel& ios, const DiscIO::WiiWAD& wad, InstallType ty
|
||||
// and does a permanent install.
|
||||
bool InstallWAD(const std::string& wad_path);
|
||||
|
||||
bool UninstallTitle(u64 title_id);
|
||||
|
||||
bool IsTitleInstalled(u64 title_id);
|
||||
|
||||
enum class UpdateResult
|
||||
{
|
||||
Succeeded,
|
||||
|
Reference in New Issue
Block a user