summaryrefslogtreecommitdiff
path: root/Source/Core/UICommon/GameFileCache.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/GameFileCache.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/GameFileCache.cpp')
-rw-r--r--Source/Core/UICommon/GameFileCache.cpp20
1 files changed, 6 insertions, 14 deletions
diff --git a/Source/Core/UICommon/GameFileCache.cpp b/Source/Core/UICommon/GameFileCache.cpp
index e2e2848f10..7a71ca75f1 100644
--- a/Source/Core/UICommon/GameFileCache.cpp
+++ b/Source/Core/UICommon/GameFileCache.cpp
@@ -20,15 +20,13 @@
#include "Common/FileSearch.h"
#include "Common/FileUtil.h"
-#include "Core/TitleDatabase.h"
-
#include "DiscIO/DirectoryBlob.h"
#include "UICommon/GameFile.h"
namespace UICommon
{
-static constexpr u32 CACHE_REVISION = 10; // Last changed in PR 6429
+static constexpr u32 CACHE_REVISION = 11; // Last changed in PR 7058
std::vector<std::string> FindAllGamePaths(const std::vector<std::string>& directories_to_scan,
bool recursive_scan)
@@ -52,8 +50,7 @@ void GameFileCache::Clear()
}
std::shared_ptr<const GameFile> GameFileCache::AddOrGet(const std::string& path,
- bool* cache_changed,
- const Core::TitleDatabase& title_database)
+ bool* cache_changed)
{
auto it = std::find_if(
m_cached_files.begin(), m_cached_files.end(),
@@ -67,7 +64,7 @@ std::shared_ptr<const GameFile> GameFileCache::AddOrGet(const std::string& path,
m_cached_files.emplace_back(std::move(game));
}
std::shared_ptr<GameFile>& result = found ? *it : m_cached_files.back();
- if (UpdateAdditionalMetadata(&result, title_database) || !found)
+ if (UpdateAdditionalMetadata(&result) || !found)
*cache_changed = true;
return result;
@@ -135,14 +132,13 @@ bool GameFileCache::Update(
}
bool GameFileCache::UpdateAdditionalMetadata(
- const Core::TitleDatabase& title_database,
std::function<void(const std::shared_ptr<const GameFile>&)> game_updated)
{
bool cache_changed = false;
for (std::shared_ptr<GameFile>& file : m_cached_files)
{
- const bool updated = UpdateAdditionalMetadata(&file, title_database);
+ const bool updated = UpdateAdditionalMetadata(&file);
cache_changed |= updated;
if (game_updated && updated)
game_updated(file);
@@ -151,13 +147,11 @@ bool GameFileCache::UpdateAdditionalMetadata(
return cache_changed;
}
-bool GameFileCache::UpdateAdditionalMetadata(std::shared_ptr<GameFile>* game_file,
- const Core::TitleDatabase& title_database)
+bool GameFileCache::UpdateAdditionalMetadata(std::shared_ptr<GameFile>* game_file)
{
const bool wii_banner_changed = (*game_file)->WiiBannerChanged();
const bool custom_banner_changed = (*game_file)->CustomBannerChanged();
- const bool custom_title_changed = (*game_file)->CustomNameChanged(title_database);
- if (!wii_banner_changed && !custom_banner_changed && !custom_title_changed)
+ if (!wii_banner_changed && !custom_banner_changed)
return false;
// If a cached file needs an update, apply the updates to a copy and delete the original.
@@ -168,8 +162,6 @@ bool GameFileCache::UpdateAdditionalMetadata(std::shared_ptr<GameFile>* game_fil
copy->WiiBannerCommit();
if (custom_banner_changed)
copy->CustomBannerCommit();
- if (custom_title_changed)
- copy->CustomNameCommit();
*game_file = std::move(copy);
return true;