Hide the file name resolution behind the interface

This commit is contained in:
Henrik Rydgård committed 2025-03-26 17:31:47 +01:00
1 parent a156697822
commit ca64734bcd
3 files changed
+20 -16

No files matched your search

+16 -10
View File
@@ -77,16 +77,6 @@ void SaveRecentIsos(Section *recent, int maxRecent) {
}
}
void AddRecentResolved(const std::string &resolvedFilename, int maxRecent) {
RemoveRecentResolved(resolvedFilename);
ResetRecentIsosThread();
std::lock_guard<std::mutex> guard(recentIsosLock);
recentIsos.insert(recentIsos.begin(), resolvedFilename);
if ((int)recentIsos.size() > maxRecent)
recentIsos.resize(maxRecent);
}
void RemoveRecentResolved(const std::string &resolvedFilename) {
ResetRecentIsosThread();
@@ -99,6 +89,22 @@ void RemoveRecentResolved(const std::string &resolvedFilename) {
recentIsos.erase(iter, recentIsos.end());
}
void AddRecent(const std::string &filename, int maxRecent) {
std::string resolvedFilename = File::ResolvePath(filename);
RemoveRecentResolved(resolvedFilename);
ResetRecentIsosThread();
std::lock_guard<std::mutex> guard(recentIsosLock);
recentIsos.insert(recentIsos.begin(), resolvedFilename);
if ((int)recentIsos.size() > maxRecent)
recentIsos.resize(maxRecent);
}
void RemoveRecent(const std::string &filename) {
std::string resolvedFilename = File::ResolvePath(filename);
RemoveRecentResolved(resolvedFilename);
}
void CleanRecentIsos() {
SetRecentIsosThread([] {
SetCurrentThreadName("RecentISOs");