From 4bee7b760545f9583c719dce46364771c4c13a88 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Fri, 16 Jun 2017 16:44:01 +0200 Subject: [PATCH] DolphinWX: Fix encoding errors in UpdateTitle An implicit conversion from std::string to wxString was to blame, as usual. Fixes issue 10341. --- Source/Core/DolphinWX/Frame.cpp | 10 +++++----- Source/Core/DolphinWX/Frame.h | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Source/Core/DolphinWX/Frame.cpp b/Source/Core/DolphinWX/Frame.cpp index 2439f37589..b4b4dd46ea 100644 --- a/Source/Core/DolphinWX/Frame.cpp +++ b/Source/Core/DolphinWX/Frame.cpp @@ -747,17 +747,17 @@ void CFrame::UninhibitScreensaver() #endif } -void CFrame::UpdateTitle(const std::string& str) +void CFrame::UpdateTitle(const wxString& str) { + const wxString revision_string = StrToWxStr(scm_rev_str); if (SConfig::GetInstance().bRenderToMain && SConfig::GetInstance().m_InterfaceStatusbar) { GetStatusBar()->SetStatusText(str, 0); - m_render_frame->SetTitle(scm_rev_str); + m_render_frame->SetTitle(revision_string); } else { - std::string titleStr = StringFromFormat("%s | %s", scm_rev_str.c_str(), str.c_str()); - m_render_frame->SetTitle(titleStr); + m_render_frame->SetTitle(revision_string + StrToWxStr(" | ") + str); } } @@ -780,7 +780,7 @@ void CFrame::OnHostMessage(wxCommandEvent& event) break; case IDM_UPDATE_TITLE: - UpdateTitle(WxStrToStr(event.GetString())); + UpdateTitle(event.GetString()); break; case IDM_WINDOW_SIZE_REQUEST: diff --git a/Source/Core/DolphinWX/Frame.h b/Source/Core/DolphinWX/Frame.h index 4d5a7282dd..432cd7496f 100644 --- a/Source/Core/DolphinWX/Frame.h +++ b/Source/Core/DolphinWX/Frame.h @@ -14,6 +14,7 @@ #include #include #include +#include #include #include "Common/CommonTypes.h" @@ -254,7 +255,7 @@ private: bool TriggerSTMPowerEvent(); void OnStopped(); void OnRenderWindowSizeRequest(int width, int height); - void UpdateTitle(const std::string& str); + void UpdateTitle(const wxString& str); static void ConnectWiimote(int wm_idx, bool connect); // Event functions