citra_qt: Update the multiplayer dialogs when game list is repopulated
The multiplayer state object and dialogs hold a (modified) game list model, but it isn't updated when the actual game list changes. This updates the multiplayer dialogs with the new game list when it got repopulated.
This commit is contained in:
@@ -41,13 +41,7 @@ HostRoomWindow::HostRoomWindow(QWidget* parent, QStandardItemModel* list,
|
||||
|
||||
// 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());
|
||||
}
|
||||
}
|
||||
UpdateGameList(list);
|
||||
|
||||
proxy = new ComboBoxProxyModel;
|
||||
proxy->setSourceModel(game_list);
|
||||
@@ -79,6 +73,16 @@ HostRoomWindow::HostRoomWindow(QWidget* parent, QStandardItemModel* list,
|
||||
|
||||
HostRoomWindow::~HostRoomWindow() = default;
|
||||
|
||||
void HostRoomWindow::UpdateGameList(QStandardItemModel* list) {
|
||||
game_list->clear();
|
||||
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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void HostRoomWindow::RetranslateUi() {
|
||||
ui->retranslateUi(this);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user