summaryrefslogtreecommitdiff
path: root/Source/Core/UICommon/GameFile.cpp
diff options
context:
space:
mode:
authorJosJuice <josjuice@gmail.com>2018-06-03 12:07:53 +0200
committerJosJuice <josjuice@gmail.com>2018-06-04 07:45:22 +0200
commit85e94cc5107dfa8b3b7569a4c0d8e251d9d0f98b (patch)
tree1ca237b1c9d10232e275caa8210ccdbff31e90aa /Source/Core/UICommon/GameFile.cpp
parent0f7370a22c67bf668fff165ac0bcff2dfc0eceb8 (diff)
Don't store custom names from TitleDatabase in GameFileCache
This saves us from having to update the GameFileCache when the TitleDatabase changes (for instance when the user changes language).
Diffstat (limited to 'Source/Core/UICommon/GameFile.cpp')
-rw-r--r--Source/Core/UICommon/GameFile.cpp31
1 files changed, 10 insertions, 21 deletions
diff --git a/Source/Core/UICommon/GameFile.cpp b/Source/Core/UICommon/GameFile.cpp
index 90f87bb016..64d4740a0e 100644
--- a/Source/Core/UICommon/GameFile.cpp
+++ b/Source/Core/UICommon/GameFile.cpp
@@ -141,20 +141,6 @@ bool GameFile::IsValid() const
return true;
}
-bool GameFile::CustomNameChanged(const Core::TitleDatabase& title_database)
-{
- const auto type = m_platform == DiscIO::Platform::WiiWAD ?
- 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 GameFile::CustomNameCommit()
-{
- m_custom_name = std::move(m_pending.custom_name);
-}
-
void GameBanner::DoState(PointerWrap& p)
{
p.Do(buffer);
@@ -191,7 +177,6 @@ void GameFile::DoState(PointerWrap& p)
m_volume_banner.DoState(p);
m_custom_banner.DoState(p);
- p.Do(m_custom_name);
}
bool GameFile::IsElfOrDol() const
@@ -280,11 +265,17 @@ void GameFile::CustomBannerCommit()
m_custom_banner = std::move(m_pending.custom_banner);
}
-const std::string& GameFile::GetName(bool long_name) const
+const std::string& GameFile::GetName(const Core::TitleDatabase& title_database) const
{
- if (!m_custom_name.empty())
- return m_custom_name;
+ const auto type = m_platform == DiscIO::Platform::WiiWAD ?
+ Core::TitleDatabase::TitleType::Channel :
+ Core::TitleDatabase::TitleType::Other;
+ const std::string& custom_name = title_database.GetTitleName(m_game_id, type);
+ return custom_name.empty() ? GetName() : custom_name;
+}
+const std::string& GameFile::GetName(bool long_name) const
+{
const std::string& name = long_name ? GetLongName() : GetShortName();
if (!name.empty())
return name;
@@ -323,9 +314,7 @@ std::string GameFile::GetUniqueIdentifier() const
if (GetRevision() != 0)
info.push_back("Revision " + std::to_string(GetRevision()));
- std::string name(GetLongName(lang));
- if (name.empty())
- name = GetName();
+ const std::string& name = GetName();
int disc_number = GetDiscNumber() + 1;