Redesign the recent files API a bit.

This commit is contained in:
Henrik Rydgård
2025-03-26 17:31:27 +01:00
parent e1be5c9279
commit a50b303a38
13 changed files with 123 additions and 122 deletions
+3 -2
View File
@@ -47,6 +47,7 @@
#include "Core/System.h"
#include "Core/FileSystems/ISOFileSystem.h"
#include "Core/Util/GameManager.h"
#include "Core/Util/RecentFiles.h"
#include "Common/Data/Text/I18n.h"
GameManager g_GameManager;
@@ -189,7 +190,7 @@ void GameManager::Update() {
installThread_.join();
}
if (cleanRecentsAfter_.exchange(false)) {
g_Config.CleanRecent();
g_recentFiles.Clean();
}
}
}
@@ -536,7 +537,7 @@ bool GameManager::DetectTexturePackDest(struct zip *z, int iniIndex, Path &dest)
std::string gameID = games.begin()->first;
if (games.size() > 1) {
// Check for any supported game on their recent list and use that instead.
for (const std::string &path : g_Config.RecentIsos()) {
for (const std::string &path : g_recentFiles.GetRecentFiles()) {
std::string recentID = GetGameID(Path(path));
if (games.find(recentID) != games.end()) {
gameID = recentID;