From 0abce1419b38a40311e8d2659163b4be6ff0e0b0 Mon Sep 17 00:00:00 2001 From: spycrab Date: Fri, 11 May 2018 21:22:57 +0200 Subject: [PATCH] Qt/NetPlayDialog: Fix broken IP label --- Source/Core/DolphinQt2/NetPlay/NetPlayDialog.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Source/Core/DolphinQt2/NetPlay/NetPlayDialog.cpp b/Source/Core/DolphinQt2/NetPlay/NetPlayDialog.cpp index 02a5415ef2..920ac11f27 100644 --- a/Source/Core/DolphinQt2/NetPlay/NetPlayDialog.cpp +++ b/Source/Core/DolphinQt2/NetPlay/NetPlayDialog.cpp @@ -312,7 +312,10 @@ void NetPlayDialog::show(std::string nickname, bool use_traversal) m_room_box->addItem(tr("Room ID")); for (const auto& iface : Settings::Instance().GetNetPlayServer()->GetInterfaceSet()) - m_room_box->addItem(iface == "!local!" ? tr("Local") : QString::fromStdString(iface)); + { + const auto interface = QString::fromStdString(iface); + m_room_box->addItem(iface == "!local!" ? tr("Local") : interface, interface); + } } m_start_button->setHidden(!is_hosting); @@ -399,7 +402,7 @@ void NetPlayDialog::UpdateGUI() { m_hostcode_label->setText( QString::fromStdString(Settings::Instance().GetNetPlayServer()->GetInterfaceHost( - m_room_box->currentText().toStdString()))); + m_room_box->currentData().toString().toStdString()))); m_hostcode_action_button->setText(tr("Copy")); m_hostcode_action_button->setEnabled(true); }