Skip to content

Commit

Permalink
Settings: Don't create deprecated achievement cache directories
Browse files Browse the repository at this point in the history
  • Loading branch information
stenzek committed Aug 18, 2024
1 parent c6d14fe commit 7ac3e2f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 18 deletions.
16 changes: 0 additions & 16 deletions src/core/achievements.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ template<typename... T>
static void ReportFmtError(fmt::format_string<T...> fmt, T&&... args);
template<typename... T>
static void ReportRCError(int err, fmt::format_string<T...> fmt, T&&... args);
static void EnsureCacheDirectoryExists();
static void ClearGameInfo();
static void ClearGameHash();
static std::string GetGameHash(CDImage* image);
Expand Down Expand Up @@ -427,8 +426,6 @@ bool Achievements::Initialize()
if (IsUsingRAIntegration())
return true;

EnsureCacheDirectoryExists();

auto lock = GetLock();
AssertMsg(g_settings.achievements_enabled, "Achievements are enabled");
Assert(!s_client && !s_http_downloader);
Expand Down Expand Up @@ -562,9 +559,6 @@ void Achievements::UpdateSettings(const Settings& old_config)
if (g_settings.achievements_unofficial_test_mode != old_config.achievements_unofficial_test_mode)
rc_client_set_unofficial_enabled(s_client, g_settings.achievements_unofficial_test_mode);
}

// in case cache directory changed
EnsureCacheDirectoryExists();
}

bool Achievements::Shutdown(bool allow_cancel)
Expand Down Expand Up @@ -609,16 +603,6 @@ bool Achievements::Shutdown(bool allow_cancel)
return true;
}

void Achievements::EnsureCacheDirectoryExists()
{
Error error;
if (const std::string path = Path::Combine(EmuFolders::Cache, CACHE_SUBDIRECTORY_NAME);
!FileSystem::EnsureDirectoryExists(path.c_str(), false, &error))
{
ReportFmtError("Failed to create cache directory '{}': {}", CACHE_SUBDIRECTORY_NAME, error.GetDescription());
}
}

void Achievements::ClientMessageCallback(const char* message, const rc_client_t* client)
{
DEV_LOG(message);
Expand Down
3 changes: 1 addition & 2 deletions src/core/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1982,8 +1982,7 @@ bool EmuFolders::EnsureFoldersExist()
{
bool result = FileSystem::EnsureDirectoryExists(Bios.c_str(), false);
result = FileSystem::EnsureDirectoryExists(Cache.c_str(), false) && result;
result = FileSystem::EnsureDirectoryExists(Path::Combine(Cache, "achievement_badge").c_str(), false) && result;
result = FileSystem::EnsureDirectoryExists(Path::Combine(Cache, "achievement_gameicon").c_str(), false) && result;
result = FileSystem::EnsureDirectoryExists(Path::Combine(Cache, "achievement_images").c_str(), false) && result;
result = FileSystem::EnsureDirectoryExists(Cheats.c_str(), false) && result;
result = FileSystem::EnsureDirectoryExists(Covers.c_str(), false) && result;
result = FileSystem::EnsureDirectoryExists(Dumps.c_str(), false) && result;
Expand Down

0 comments on commit 7ac3e2f

Please sign in to comment.