Qt: Reduce game list jank after shutting down VM

Prevents progress bar briefly appearing, and the list scrolling to the
top when you exit a game.
This commit is contained in:
Stenzek
2024-08-03 00:50:02 +10:00
parent 3a83c4265c
commit 9a626caad9
8 changed files with 98 additions and 27 deletions

View File

@ -119,15 +119,15 @@ static std::string GetCustomPropertiesFile();
static FileSystem::ManagedCFilePtr OpenMemoryCardTimestampCache(bool for_write);
static bool UpdateMemcardTimestampCache(const MemcardTimestampCacheEntry& entry);
} // namespace GameList
static std::vector<GameList::Entry> s_entries;
static EntryList s_entries;
static std::recursive_mutex s_mutex;
static GameList::CacheMap s_cache_map;
static std::vector<GameList::MemcardTimestampCacheEntry> s_memcard_timestamp_cache_entries;
static CacheMap s_cache_map;
static std::vector<MemcardTimestampCacheEntry> s_memcard_timestamp_cache_entries;
static bool s_game_list_loaded = false;
} // namespace GameList
const char* GameList::GetEntryTypeName(EntryType type)
{
static std::array<const char*, static_cast<int>(EntryType::Count)> names = {
@ -823,6 +823,13 @@ void GameList::Refresh(bool invalidate_cache, bool only_cache, ProgressCallback*
CreateDiscSetEntries(played_time);
}
GameList::EntryList GameList::TakeEntryList()
{
EntryList ret = std::move(s_entries);
s_entries = {};
return ret;
}
void GameList::CreateDiscSetEntries(const PlayedTimeMap& played_time_map)
{
std::unique_lock lock(s_mutex);