mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-20 19:45:20 +00:00
Qt: fix CurrentSelectionIconPath()
This commit is contained in:
parent
fbde1818a2
commit
ef6a36241e
1 changed files with 4 additions and 9 deletions
|
@ -1232,18 +1232,13 @@ std::string game_list_frame::CurrentSelectionIconPath()
|
|||
{
|
||||
std::string selection = "";
|
||||
|
||||
// The index can be more than the size of m_game_data if you use the VFS to load a directory which has less games.
|
||||
if (m_oldLayoutIsList && m_gameList->selectedItems().count() && m_gameList->currentRow() < m_game_data.size())
|
||||
if (m_gameList->selectedItems().count())
|
||||
{
|
||||
selection = m_game_data.at(m_gameList->item(m_gameList->currentRow(), 0)->data(Qt::UserRole).toInt()).info.icon_path;
|
||||
}
|
||||
else if (!m_oldLayoutIsList && m_xgrid->selectedItems().count())
|
||||
{
|
||||
int ind = m_xgrid->currentItem()->data(Qt::UserRole).toInt();
|
||||
QTableWidgetItem* item = m_oldLayoutIsList ? m_gameList->item(m_gameList->currentRow(), 0) : m_xgrid->currentItem();
|
||||
int ind = item->data(Qt::UserRole).toInt();
|
||||
|
||||
if (ind < m_game_data.size())
|
||||
{
|
||||
selection = m_game_data.at(ind).info.icon_path;
|
||||
}
|
||||
}
|
||||
|
||||
m_oldLayoutIsList = m_isListLayout;
|
||||
|
|
Loading…
Add table
Reference in a new issue