DolphinWX: Fix encoding errors in UpdateTitle

An implicit conversion from std::string to wxString
was to blame, as usual. Fixes issue 10341.
This commit is contained in:
JosJuice 2017-06-16 16:44:01 +02:00
parent 13b1fa2c65
commit 4bee7b7605
2 changed files with 7 additions and 6 deletions

View File

@ -747,17 +747,17 @@ void CFrame::UninhibitScreensaver()
#endif #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) if (SConfig::GetInstance().bRenderToMain && SConfig::GetInstance().m_InterfaceStatusbar)
{ {
GetStatusBar()->SetStatusText(str, 0); GetStatusBar()->SetStatusText(str, 0);
m_render_frame->SetTitle(scm_rev_str); m_render_frame->SetTitle(revision_string);
} }
else else
{ {
std::string titleStr = StringFromFormat("%s | %s", scm_rev_str.c_str(), str.c_str()); m_render_frame->SetTitle(revision_string + StrToWxStr(" | ") + str);
m_render_frame->SetTitle(titleStr);
} }
} }
@ -780,7 +780,7 @@ void CFrame::OnHostMessage(wxCommandEvent& event)
break; break;
case IDM_UPDATE_TITLE: case IDM_UPDATE_TITLE:
UpdateTitle(WxStrToStr(event.GetString())); UpdateTitle(event.GetString());
break; break;
case IDM_WINDOW_SIZE_REQUEST: case IDM_WINDOW_SIZE_REQUEST:

View File

@ -14,6 +14,7 @@
#include <wx/frame.h> #include <wx/frame.h>
#include <wx/image.h> #include <wx/image.h>
#include <wx/panel.h> #include <wx/panel.h>
#include <wx/string.h>
#include <wx/timer.h> #include <wx/timer.h>
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
@ -254,7 +255,7 @@ private:
bool TriggerSTMPowerEvent(); bool TriggerSTMPowerEvent();
void OnStopped(); void OnStopped();
void OnRenderWindowSizeRequest(int width, int height); 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); static void ConnectWiimote(int wm_idx, bool connect);
// Event functions // Event functions