diff options
| author | Léo Lam <leo@leolam.fr> | 2020-10-20 13:31:01 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-20 13:31:01 +0200 |
| commit | 2e86e1a9989340a41388e48d04ca9acd31e0b0d0 (patch) | |
| tree | 8a626dd39a90bbd748d82730e363851ac8823c6f /Source/Core | |
| parent | 49b7f10b39816649dc5a5c3e0d559d96dbb6c0ba (diff) | |
| parent | 6380c65ff858c9147e5f7d7da21219db52853682 (diff) | |
Merge pull request #9146 from JosJuice/android-disable-cover-download
Android: Allow disabling cover downloading
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/Core/Config/UISettings.cpp | 4 | ||||
| -rw-r--r-- | Source/Core/UICommon/GameFile.cpp | 17 |
2 files changed, 18 insertions, 3 deletions
diff --git a/Source/Core/Core/Config/UISettings.cpp b/Source/Core/Core/Config/UISettings.cpp index bdd61b1d1e..60d33033ca 100644 --- a/Source/Core/Core/Config/UISettings.cpp +++ b/Source/Core/Core/Config/UISettings.cpp @@ -9,7 +9,11 @@ namespace Config // UI.General const Info<bool> MAIN_USE_DISCORD_PRESENCE{{System::Main, "General", "UseDiscordPresence"}, true}; +#ifdef ANDROID +const Info<bool> MAIN_USE_GAME_COVERS{{System::Main, "General", "UseGameCovers"}, true}; +#else const Info<bool> MAIN_USE_GAME_COVERS{{System::Main, "General", "UseGameCovers"}, false}; +#endif const Info<bool> MAIN_FOCUSED_HOTKEYS{{System::Main, "General", "HotkeysRequireFocus"}, true}; const Info<bool> MAIN_RECURSIVE_ISO_PATHS{{System::Main, "General", "RecursiveISOPaths"}, false}; diff --git a/Source/Core/UICommon/GameFile.cpp b/Source/Core/UICommon/GameFile.cpp index 102075e510..a169ef0f66 100644 --- a/Source/Core/UICommon/GameFile.cpp +++ b/Source/Core/UICommon/GameFile.cpp @@ -52,6 +52,17 @@ namespace UICommon namespace { const std::string EMPTY_STRING; + +bool UseGameCovers() +{ +#ifdef ANDROID + // Android has its own code for handling covers, written completely in Java. + // It's best if we disable the C++ cover code on Android to avoid duplicated data and such. + return false; +#else + return Config::Get(Config::MAIN_USE_GAME_COVERS); +#endif +} } // Anonymous namespace DiscIO::Language GameFile::GetConfigLanguage() const @@ -169,7 +180,7 @@ bool GameFile::IsValid() const bool GameFile::CustomCoverChanged() { - if (!m_custom_cover.buffer.empty() || !Config::Get(Config::MAIN_USE_GAME_COVERS)) + if (!m_custom_cover.buffer.empty() || !UseGameCovers()) return false; std::string path, name; @@ -196,7 +207,7 @@ bool GameFile::CustomCoverChanged() void GameFile::DownloadDefaultCover() { - if (!m_default_cover.buffer.empty() || !Config::Get(Config::MAIN_USE_GAME_COVERS)) + if (!m_default_cover.buffer.empty() || !UseGameCovers()) return; const auto cover_path = File::GetUserPath(D_COVERCACHE_IDX) + DIR_SEP; @@ -262,7 +273,7 @@ void GameFile::DownloadDefaultCover() bool GameFile::DefaultCoverChanged() { - if (!m_default_cover.buffer.empty() || !Config::Get(Config::MAIN_USE_GAME_COVERS)) + if (!m_default_cover.buffer.empty() || !UseGameCovers()) return false; const auto cover_path = File::GetUserPath(D_COVERCACHE_IDX) + DIR_SEP; |
