From 31a9fdb00b4c98538cf60d60ceb40d423b9ffe57 Mon Sep 17 00:00:00 2001 From: BreadFish64 Date: Mon, 21 May 2018 20:53:48 -0500 Subject: [PATCH] fix preffered game --- src/citra_qt/multiplayer/host_room.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/citra_qt/multiplayer/host_room.cpp b/src/citra_qt/multiplayer/host_room.cpp index 99bd83545d..ecde21fd48 100644 --- a/src/citra_qt/multiplayer/host_room.cpp +++ b/src/citra_qt/multiplayer/host_room.cpp @@ -25,7 +25,7 @@ HostRoomWindow::HostRoomWindow(QWidget* parent, QStandardItemModel* list, std::shared_ptr session) : QDialog(parent, Qt::WindowTitleHint | Qt::WindowCloseButtonHint | Qt::WindowSystemMenuHint), - ui(std::make_unique()), announce_multiplayer_session(session), game_list(list) { + ui(std::make_unique()), announce_multiplayer_session(session) { ui->setupUi(this); // set up validation for all of the fields @@ -35,6 +35,15 @@ HostRoomWindow::HostRoomWindow(QWidget* parent, QStandardItemModel* list, ui->port->setPlaceholderText(QString::number(Network::DefaultRoomPort)); // Create a proxy to the game list to display the list of preferred games + game_list = new QStandardItemModel; + + for (int i = 0; i < list->rowCount(); i++) { + auto parent = list->item(i, 0); + for (int j = 0; j < parent->rowCount(); j++) { + game_list->appendRow(parent->child(j)->clone()); + } + } + proxy = new ComboBoxProxyModel; proxy->setSourceModel(game_list); proxy->sort(0, Qt::AscendingOrder);