diff options
| author | Lioncash <mathew1800@gmail.com> | 2018-04-16 16:02:21 -0400 |
|---|---|---|
| committer | Lioncash <mathew1800@gmail.com> | 2018-04-16 16:46:44 -0400 |
| commit | ca6a2970ea83d0850040aa3334e52d83ae0657dc (patch) | |
| tree | c8c3e6d15ebd9c2028ba8b83babcd04e9b4b54b4 /Source/Core/DolphinWX/NetPlay/NetWindow.cpp | |
| parent | dfd6a228a69021ca88daaee2de457871f77f8c77 (diff) | |
TraversalClient: Make data externally read-only members private
These are only ever queried for state, not written. Therefore, prevent writing to the members
and make them private.
Diffstat (limited to 'Source/Core/DolphinWX/NetPlay/NetWindow.cpp')
| -rw-r--r-- | Source/Core/DolphinWX/NetPlay/NetWindow.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Source/Core/DolphinWX/NetPlay/NetWindow.cpp b/Source/Core/DolphinWX/NetPlay/NetWindow.cpp index cd4bba69a6..1ece3e1bc1 100644 --- a/Source/Core/DolphinWX/NetPlay/NetWindow.cpp +++ b/Source/Core/DolphinWX/NetPlay/NetWindow.cpp @@ -777,7 +777,7 @@ void NetPlayDialog::UpdateHostLabel() if (sel == 0) { // the traversal ID - switch (g_TraversalClient->m_State) + switch (g_TraversalClient->GetState()) { case TraversalClient::Connecting: m_host_label->SetForegroundColour(*wxLIGHT_GREY); @@ -786,13 +786,15 @@ void NetPlayDialog::UpdateHostLabel() m_host_copy_btn->Disable(); break; case TraversalClient::Connected: + { + const auto host_id = g_TraversalClient->GetHostID(); m_host_label->SetForegroundColour(*wxBLACK); - m_host_label->SetLabel( - wxString(g_TraversalClient->m_HostId.data(), g_TraversalClient->m_HostId.size())); + m_host_label->SetLabel(wxString(host_id.data(), host_id.size())); m_host_copy_btn->SetLabel(_("Copy")); m_host_copy_btn->Enable(); m_host_copy_btn_is_retry = false; break; + } case TraversalClient::Failure: m_host_label->SetForegroundColour(*wxBLACK); m_host_label->SetLabel("..."); |
