mirror of
https://github.com/stenzek/duckstation.git
synced 2025-07-18 16:10:07 +00:00
Qt: Check cache when getting game icon for window
Apparently forgot this...
This commit is contained in:
parent
9e319ff495
commit
2308c5ddc6
@ -393,11 +393,19 @@ QIcon GameListModel::getIconForGame(const QString& path)
|
||||
{
|
||||
QIcon ret;
|
||||
|
||||
if (m_show_game_icons)
|
||||
if (m_show_game_icons && !path.isEmpty())
|
||||
{
|
||||
const auto lock = GameList::GetLock();
|
||||
const GameList::Entry* entry = GameList::GetEntryForPath(path.toStdString());
|
||||
|
||||
if (const QPixmap* pm = m_memcard_pixmap_cache.Lookup(entry->serial))
|
||||
{
|
||||
// If we already have the icon cached, return it.
|
||||
ret = QIcon(*pm);
|
||||
return ret;
|
||||
}
|
||||
else
|
||||
{
|
||||
// See above.
|
||||
if (entry && !entry->serial.empty() && (entry->IsDisc() || entry->IsDiscSet()))
|
||||
{
|
||||
@ -409,6 +417,8 @@ QIcon GameListModel::getIconForGame(const QString& path)
|
||||
{
|
||||
fixIconPixmapSize(newpm);
|
||||
ret = QIcon(*m_memcard_pixmap_cache.Insert(entry->serial, std::move(newpm)));
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user