summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinWX/ISOFile.cpp
diff options
context:
space:
mode:
authorEmptyChaos <EmptyChaos@users.noreply.github.com>2016-05-29 14:49:11 +0000
committerEmptyChaos <EmptyChaos@users.noreply.github.com>2016-05-30 00:49:11 +1000
commit309d0e59f4697fdfc2763c7d3ee0075c514abe9b (patch)
tree5fbf52b0b0ba45beac379434b28b42e84692f260 /Source/Core/DolphinWX/ISOFile.cpp
parent6ab1b2747714179783d0a2946acc9408eef2d950 (diff)
ISOProperties/GameListCtrl: Use Global INI Change event.
ISOProperties no longer needs its hack to refresh the game list, the new INI Modified event can be used instead.
Diffstat (limited to 'Source/Core/DolphinWX/ISOFile.cpp')
-rw-r--r--Source/Core/DolphinWX/ISOFile.cpp46
1 files changed, 28 insertions, 18 deletions
diff --git a/Source/Core/DolphinWX/ISOFile.cpp b/Source/Core/DolphinWX/ISOFile.cpp
index 3312394dda..886837af52 100644
--- a/Source/Core/DolphinWX/ISOFile.cpp
+++ b/Source/Core/DolphinWX/ISOFile.cpp
@@ -124,27 +124,19 @@ GameListItem::GameListItem(const std::string& _rFileName, const std::unordered_m
if (IsValid())
{
- IniFile ini = SConfig::LoadGameIni(m_UniqueID, m_Revision);
- ini.GetIfExists("EmuState", "EmulationStateId", &m_emu_state);
- ini.GetIfExists("EmuState", "EmulationIssues", &m_issues);
- m_has_custom_name = ini.GetIfExists("EmuState", "Title", &m_custom_name);
+ std::string game_id = m_UniqueID;
- if (!m_has_custom_name)
+ // Ignore publisher ID for WAD files
+ if (m_Platform == DiscIO::IVolume::WII_WAD && game_id.size() > 4)
+ game_id.erase(4);
+
+ auto it = custom_titles.find(game_id);
+ if (it != custom_titles.end())
{
- std::string game_id = m_UniqueID;
-
- // Ignore publisher ID for WAD files
- if (m_Platform == DiscIO::IVolume::WII_WAD && game_id.size() > 4)
- game_id.erase(4);
-
- auto end = custom_titles.end();
- auto it = custom_titles.find(game_id);
- if (it != end)
- {
- m_custom_name = it->second;
- m_has_custom_name = true;
- }
+ m_custom_name_titles_txt = it->second;
}
+
+ ReloadINI();
}
if (!IsValid() && IsElfOrDol())
@@ -183,6 +175,24 @@ GameListItem::~GameListItem()
{
}
+void GameListItem::ReloadINI()
+{
+ if (!IsValid())
+ return;
+
+ IniFile ini = SConfig::LoadGameIni(m_UniqueID, m_Revision);
+ ini.GetIfExists("EmuState", "EmulationStateId", &m_emu_state, 0);
+ ini.GetIfExists("EmuState", "EmulationIssues", &m_issues, std::string());
+
+ m_custom_name.clear();
+ m_has_custom_name = ini.GetIfExists("EmuState", "Title", &m_custom_name);
+ if (!m_has_custom_name && !m_custom_name_titles_txt.empty())
+ {
+ m_custom_name = m_custom_name_titles_txt;
+ m_has_custom_name = true;
+ }
+}
+
bool GameListItem::LoadFromCache()
{
return CChunkFileReader::Load<GameListItem>(CreateCacheFilename(), CACHE_REVISION, *this);