Qt/GameList: Fix incorrect game booting when sorted

This commit is contained in:
Connor McLaughlin 2020-01-24 14:49:44 +10:00
parent 9326cecd65
commit 99af858562
1 changed files with 4 additions and 3 deletions

View File

@ -281,11 +281,12 @@ void GameListWidget::onGameListRefreshed()
void GameListWidget::onTableViewItemDoubleClicked(const QModelIndex& index)
{
if (!index.isValid() || index.row() >= static_cast<int>(m_game_list->GetEntryCount()))
const QModelIndex source_index = m_table_sort_model->mapToSource(index);
if (!source_index.isValid() || source_index.row() >= static_cast<int>(m_game_list->GetEntryCount()))
return;
const GameList::GameListEntry& entry = m_game_list->GetEntries().at(index.row());
emit bootEntryRequested(entry);
const GameList::GameListEntry& entry = m_game_list->GetEntries().at(source_index.row());
emit bootEntryRequested(&entry);
}
void GameListWidget::resizeEvent(QResizeEvent* event)