summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinQt/NetPlay/NetPlaySetupDialog.cpp
diff options
context:
space:
mode:
authorChristian Aguilera <cristian64@gmail.com>2019-01-17 22:28:07 +0000
committerChristian Aguilera <cristian64@gmail.com>2020-10-01 22:09:45 +0200
commit5b757024c440b0a3b69406418fdcef2d94443b03 (patch)
tree759c41cb5ea4f99801e15f62523bab462e083dbc /Source/Core/DolphinQt/NetPlay/NetPlaySetupDialog.cpp
parent0d02e70d4a8a6bade5c9699da69219a31ca412b1 (diff)
GameListModel instance ownership transferred back to the GameList instance. The GameListModel instance will be passed as a constructor parameter where needed.
Diffstat (limited to 'Source/Core/DolphinQt/NetPlay/NetPlaySetupDialog.cpp')
-rw-r--r--Source/Core/DolphinQt/NetPlay/NetPlaySetupDialog.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/Source/Core/DolphinQt/NetPlay/NetPlaySetupDialog.cpp b/Source/Core/DolphinQt/NetPlay/NetPlaySetupDialog.cpp
index adcfa3faf3..521ec48745 100644
--- a/Source/Core/DolphinQt/NetPlay/NetPlaySetupDialog.cpp
+++ b/Source/Core/DolphinQt/NetPlay/NetPlaySetupDialog.cpp
@@ -21,7 +21,6 @@
#include "Core/Config/NetplaySettings.h"
#include "Core/NetPlayProto.h"
-#include "DolphinQt/GameList/GameListModel.h"
#include "DolphinQt/QtUtils/ModalMessageBox.h"
#include "DolphinQt/QtUtils/UTF8CodePointCountValidator.h"
#include "DolphinQt/Settings.h"
@@ -29,8 +28,8 @@
#include "UICommon/GameFile.h"
#include "UICommon/NetPlayIndex.h"
-NetPlaySetupDialog::NetPlaySetupDialog(QWidget* parent)
- : QDialog(parent), m_game_list_model(Settings::Instance().GetGameListModel())
+NetPlaySetupDialog::NetPlaySetupDialog(const GameListModel& game_list_model, QWidget* parent)
+ : QDialog(parent), m_game_list_model(game_list_model)
{
setWindowTitle(tr("NetPlay Setup"));
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
@@ -359,12 +358,12 @@ void NetPlaySetupDialog::PopulateGameList()
QSignalBlocker blocker(m_host_games);
m_host_games->clear();
- for (int i = 0; i < m_game_list_model->rowCount(QModelIndex()); i++)
+ for (int i = 0; i < m_game_list_model.rowCount(QModelIndex()); i++)
{
- std::shared_ptr<const UICommon::GameFile> game = m_game_list_model->GetGameFile(i);
+ std::shared_ptr<const UICommon::GameFile> game = m_game_list_model.GetGameFile(i);
auto* item =
- new QListWidgetItem(QString::fromStdString(m_game_list_model->GetNetPlayName(*game)));
+ new QListWidgetItem(QString::fromStdString(m_game_list_model.GetNetPlayName(*game)));
item->setData(Qt::UserRole, QVariant::fromValue(std::move(game)));
m_host_games->addItem(item);
}