summaryrefslogtreecommitdiff
path: root/Source/Core/DiscIO/Src/NANDContentLoader.cpp
diff options
context:
space:
mode:
authorLPFaint99 <lpfaint99@gmail.com>2011-03-05 05:18:21 +0000
committerLPFaint99 <lpfaint99@gmail.com>2011-03-05 05:18:21 +0000
commit278cb45eb94adc812b7e7879a6e7267c45276aad (patch)
tree85817df2e7794535affd099b98be4afa8a2f0ff4 /Source/Core/DiscIO/Src/NANDContentLoader.cpp
parent3b1e7ac372f402e11f8737fb230322e52e8ebcd9 (diff)
deleting a channel via the wii sysmenu works now
Implement ES_DELETETICKET & ES_DELETETITLECONTENT git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7292 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/DiscIO/Src/NANDContentLoader.cpp')
-rw-r--r--Source/Core/DiscIO/Src/NANDContentLoader.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/Source/Core/DiscIO/Src/NANDContentLoader.cpp b/Source/Core/DiscIO/Src/NANDContentLoader.cpp
index 6d1a8f7240..67a915fc17 100644
--- a/Source/Core/DiscIO/Src/NANDContentLoader.cpp
+++ b/Source/Core/DiscIO/Src/NANDContentLoader.cpp
@@ -108,6 +108,7 @@ public:
virtual ~CNANDContentLoader();
bool IsValid() const { return m_Valid; }
+ void RemoveTitle(void) const;
u64 GetTitleID() const { return m_TitleID; }
u16 GetIosVersion() const { return m_IosVersion; }
u32 GetBootIndex() const { return m_BootIndex; }
@@ -390,6 +391,32 @@ const INANDContentLoader& CNANDContentManager::GetNANDLoader(u64 _titleId, bool
std::string _rName = Common::CreateTitleContentPath(_titleId);
return GetNANDLoader(_rName, forceReload);
}
+bool CNANDContentManager::RemoveTitle(u64 _titleID)
+{
+ if (!GetNANDLoader(_titleID).IsValid())
+ return false;
+ GetNANDLoader(_titleID).RemoveTitle();
+ return GetNANDLoader(_titleID, true).IsValid();
+}
+
+void CNANDContentLoader::RemoveTitle() const
+{
+ INFO_LOG(DISCIO, "RemoveTitle %08x/%08x", (u32)(m_TitleID >> 32), (u32)m_TitleID);
+ if(IsValid())
+ {
+ // remove tmd?
+ for (u32 i = 0; i < m_numEntries; i++)
+ {
+ char szFilename[1024];
+ if (!(m_Content[i].m_Type & 0x8000)) // skip shared apps
+ {
+ sprintf(szFilename, "%s/%08x.app", Common::CreateTitleContentPath(m_TitleID).c_str(), m_Content[i].m_ContentID);
+ INFO_LOG(DISCIO, "Delete %s", szFilename);
+ File::Delete(szFilename);
+ }
+ }
+ }
+}
cUIDsys::cUIDsys()
{