summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinWX/ISOFile.cpp
diff options
context:
space:
mode:
authorshuffle2 <godisgovernment@gmail.com>2017-06-27 01:48:22 -0700
committerGitHub <noreply@github.com>2017-06-27 01:48:22 -0700
commit540ee18966072735e7d07b770223d0ac7a58cb95 (patch)
tree21e2fbd7df80e4be19a8084f4d951f38eda47c7d /Source/Core/DolphinWX/ISOFile.cpp
parent599a235a19392c6372adf303b3d20fdfeba5a7df (diff)
parent7d801d61dcc71e8f81e6d022e0c60ece2c5a7456 (diff)
Merge pull request #5699 from JosJuice/wx-custom-titles
DolphinWX: Sync custom title changes on game list rescan
Diffstat (limited to 'Source/Core/DolphinWX/ISOFile.cpp')
-rw-r--r--Source/Core/DolphinWX/ISOFile.cpp26
1 files changed, 16 insertions, 10 deletions
diff --git a/Source/Core/DolphinWX/ISOFile.cpp b/Source/Core/DolphinWX/ISOFile.cpp
index 5f01889a29..3b607e8cf2 100644
--- a/Source/Core/DolphinWX/ISOFile.cpp
+++ b/Source/Core/DolphinWX/ISOFile.cpp
@@ -61,7 +61,7 @@ static std::string GetLanguageString(DiscIO::Language language,
return "";
}
-GameListItem::GameListItem(const std::string& filename, const Core::TitleDatabase& title_database)
+GameListItem::GameListItem(const std::string& filename)
: m_file_name(filename), m_region(DiscIO::Region::UNKNOWN_REGION),
m_country(DiscIO::Country::COUNTRY_UNKNOWN)
{
@@ -100,14 +100,6 @@ GameListItem::GameListItem(const std::string& filename, const Core::TitleDatabas
if (m_company.empty() && m_game_id.size() >= 6)
m_company = DiscIO::GetCompanyFromID(m_game_id.substr(4, 2));
- if (IsValid())
- {
- const auto type = m_platform == DiscIO::Platform::WII_WAD ?
- Core::TitleDatabase::TitleType::Channel :
- Core::TitleDatabase::TitleType::Other;
- m_custom_name = title_database.GetTitleName(m_game_id, type);
- }
-
if (!IsValid() && IsElfOrDol())
{
m_valid = true;
@@ -147,6 +139,20 @@ bool GameListItem::IsValid() const
return true;
}
+bool GameListItem::CustomNameChanged(const Core::TitleDatabase& title_database)
+{
+ const auto type = m_platform == DiscIO::Platform::WII_WAD ?
+ Core::TitleDatabase::TitleType::Channel :
+ Core::TitleDatabase::TitleType::Other;
+ m_pending.custom_name = title_database.GetTitleName(m_game_id, type);
+ return m_custom_name != m_pending.custom_name;
+}
+
+void GameListItem::CustomNameCommit()
+{
+ m_custom_name = std::move(m_pending.custom_name);
+}
+
bool GameListItem::EmuStateChanged()
{
IniFile ini = SConfig::LoadGameIni(m_game_id, m_revision);
@@ -157,7 +163,7 @@ bool GameListItem::EmuStateChanged()
void GameListItem::EmuStateCommit()
{
- m_emu_state = m_pending.emu_state;
+ m_emu_state = std::move(m_pending.emu_state);
}
void GameListItem::EmuState::DoState(PointerWrap& p)