diff options
| author | LPFaint99 <lpfaint99@gmail.com> | 2011-03-05 05:07:44 +0000 |
|---|---|---|
| committer | LPFaint99 <lpfaint99@gmail.com> | 2011-03-05 05:07:44 +0000 |
| commit | 708f6f7299f4ec8646d204236eb30939ddfc238e (patch) | |
| tree | 3e14970061b8f4495d4cfee1280c27ad26f8512b /Source/Core/DiscIO/Src/NANDContentLoader.cpp | |
| parent | 15ca7b72e6bab5b5c243bb813ea20f9f612ebd78 (diff) | |
Replace install wii menu option tools to install wad
Add the option to clear a title from the NANDContentLoader and attempt to reload it
This allows the using the system menu immediately after installing rather than requiring a relaunch
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7290 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/DiscIO/Src/NANDContentLoader.cpp')
| -rw-r--r-- | Source/Core/DiscIO/Src/NANDContentLoader.cpp | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/Source/Core/DiscIO/Src/NANDContentLoader.cpp b/Source/Core/DiscIO/Src/NANDContentLoader.cpp index 8de4eff0d5..6d1a8f7240 100644 --- a/Source/Core/DiscIO/Src/NANDContentLoader.cpp +++ b/Source/Core/DiscIO/Src/NANDContentLoader.cpp @@ -366,20 +366,29 @@ CNANDContentManager::~CNANDContentManager() m_Map.clear(); } -const INANDContentLoader& CNANDContentManager::GetNANDLoader(const std::string& _rName) +const INANDContentLoader& CNANDContentManager::GetNANDLoader(const std::string& _rName, bool forceReload) { CNANDContentMap::iterator lb = m_Map.lower_bound(_rName); if(lb == m_Map.end() || (m_Map.key_comp()(_rName, lb->first))) + { m_Map.insert(lb, CNANDContentMap::value_type(_rName, new CNANDContentLoader(_rName))); - + } + else + { + if (!lb->second->IsValid() || forceReload) + { + delete lb->second; + lb->second = new CNANDContentLoader(_rName); + } + } return *m_Map[_rName]; } -const INANDContentLoader& CNANDContentManager::GetNANDLoader(u64 _titleId) +const INANDContentLoader& CNANDContentManager::GetNANDLoader(u64 _titleId, bool forceReload) { std::string _rName = Common::CreateTitleContentPath(_titleId); - return GetNANDLoader(_rName); + return GetNANDLoader(_rName, forceReload); } cUIDsys::cUIDsys() @@ -411,7 +420,7 @@ cUIDsys::cUIDsys() if (pFile) { if (fwrite(&Element, sizeof(SElement), 1, pFile) != 1) - ERROR_LOG(DISCIO, "fwrite failed"); + ERROR_LOG(DISCIO, "Failed to write to %s", uidSys); fclose(pFile); } } |
