summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinQt/NetPlay/NetPlaySetupDialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/DolphinQt/NetPlay/NetPlaySetupDialog.cpp')
-rw-r--r--Source/Core/DolphinQt/NetPlay/NetPlaySetupDialog.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/Source/Core/DolphinQt/NetPlay/NetPlaySetupDialog.cpp b/Source/Core/DolphinQt/NetPlay/NetPlaySetupDialog.cpp
index a9e31f5ed4..5f51f4a7cd 100644
--- a/Source/Core/DolphinQt/NetPlay/NetPlaySetupDialog.cpp
+++ b/Source/Core/DolphinQt/NetPlay/NetPlaySetupDialog.cpp
@@ -4,6 +4,8 @@
#include "DolphinQt/NetPlay/NetPlaySetupDialog.h"
+#include <memory>
+
#include <QCheckBox>
#include <QComboBox>
#include <QDialogButtonBox>
@@ -24,6 +26,7 @@
#include "DolphinQt/QtUtils/UTF8CodePointCountValidator.h"
#include "DolphinQt/Settings.h"
+#include "UICommon/GameFile.h"
#include "UICommon/NetPlayIndex.h"
NetPlaySetupDialog::NetPlaySetupDialog(QWidget* parent)
@@ -347,7 +350,7 @@ void NetPlaySetupDialog::accept()
return;
}
- emit Host(items[0]->text());
+ emit Host(*items[0]->data(Qt::UserRole).value<std::shared_ptr<const UICommon::GameFile>>());
}
}
@@ -358,11 +361,10 @@ void NetPlaySetupDialog::PopulateGameList()
m_host_games->clear();
for (int i = 0; i < m_game_list_model->rowCount(QModelIndex()); i++)
{
- auto title = m_game_list_model->GetUniqueIdentifier(i);
- auto path = m_game_list_model->GetPath(i);
+ std::shared_ptr<const UICommon::GameFile> game = m_game_list_model->GetGameFile(i);
- auto* item = new QListWidgetItem(title);
- item->setData(Qt::UserRole, path);
+ auto* item = new QListWidgetItem(QString::fromStdString(game->GetNetPlayName()));
+ item->setData(Qt::UserRole, QVariant::fromValue(std::move(game)));
m_host_games->addItem(item);
}