summaryrefslogtreecommitdiff
path: root/Source/Core/UICommon/GameFile.cpp
diff options
context:
space:
mode:
authorLéo Lam <leo@innovatetechnologi.es>2018-06-04 14:59:05 +0200
committerGitHub <noreply@github.com>2018-06-04 14:59:05 +0200
commit8e0ea92ec35a0473e79ef012b9f98b7a38d3ef33 (patch)
tree244b8e04d4b603b2f349331447998960cfa9ea32 /Source/Core/UICommon/GameFile.cpp
parent8074192a85557feaf84d4aaab9ab42b02464220b (diff)
parent85e94cc5107dfa8b3b7569a4c0d8e251d9d0f98b (diff)
Merge pull request #7058 from JosJuice/move-titledatabase-usage
Don't store custom names from TitleDatabase in GameFileCache
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;