From 99af858562777c04953b01e7fe1dd1886f768fcf Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Fri, 24 Jan 2020 14:49:44 +1000 Subject: [PATCH] Qt/GameList: Fix incorrect game booting when sorted --- src/duckstation-qt/gamelistwidget.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/duckstation-qt/gamelistwidget.cpp b/src/duckstation-qt/gamelistwidget.cpp index 4ce274c15..f36afeed4 100644 --- a/src/duckstation-qt/gamelistwidget.cpp +++ b/src/duckstation-qt/gamelistwidget.cpp @@ -281,11 +281,12 @@ void GameListWidget::onGameListRefreshed() void GameListWidget::onTableViewItemDoubleClicked(const QModelIndex& index) { - if (!index.isValid() || index.row() >= static_cast(m_game_list->GetEntryCount())) + const QModelIndex source_index = m_table_sort_model->mapToSource(index); + if (!source_index.isValid() || source_index.row() >= static_cast(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)