summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinQt/NetPlay/NetPlaySetupDialog.cpp
diff options
context:
space:
mode:
authorJMC47 <JMC4789@gmail.com>2020-09-06 17:14:08 -0400
committerGitHub <noreply@github.com>2020-09-06 17:14:08 -0400
commite7e51756068a450b6e920c7783c81d7df4d2d133 (patch)
tree94f0bfe833986f8d35f0d2a40842807601f53b9f /Source/Core/DolphinQt/NetPlay/NetPlaySetupDialog.cpp
parent344fdabf23c048b81b8e87008a7a16837d180f55 (diff)
parentfc6c1931fa09513388f35507b724bc378a0758e1 (diff)
Merge pull request #8861 from JosJuice/netplay-hash
Make netplay's "same game" check more robust
Diffstat (limited to 'Source/Core/DolphinQt/NetPlay/NetPlaySetupDialog.cpp')
-rw-r--r--Source/Core/DolphinQt/NetPlay/NetPlaySetupDialog.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/Source/Core/DolphinQt/NetPlay/NetPlaySetupDialog.cpp b/Source/Core/DolphinQt/NetPlay/NetPlaySetupDialog.cpp
index a9e31f5ed4..adcfa3faf3 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,11 @@ 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(m_game_list_model->GetNetPlayName(*game)));
+ item->setData(Qt::UserRole, QVariant::fromValue(std::move(game)));
m_host_games->addItem(item);
}