mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 21:30:19 -06:00
GameListModel instance ownership transferred back to the GameList instance. The GameListModel instance will be passed as a constructor parameter where needed.
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user