mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-30 01:29:42 -06:00
Fix loading of "themes" with non-ascii character names.
Fixed issue 6189. Why did GetUserPath return a non-const ref to string..?
This commit is contained in:
@ -617,16 +617,17 @@ void CConfigMain::CreateGUIControls()
|
||||
SplitPath(filename, NULL, &name, &ext);
|
||||
|
||||
name += ext;
|
||||
if (-1 == theme_selection->FindString(name))
|
||||
theme_selection->Append(name);
|
||||
auto const wxname = StrToWxStr(name);
|
||||
if (-1 == theme_selection->FindString(wxname))
|
||||
theme_selection->Append(wxname);
|
||||
});
|
||||
|
||||
theme_selection->SetStringSelection(SConfig::GetInstance().m_LocalCoreStartupParameter.theme_name);
|
||||
theme_selection->SetStringSelection(StrToWxStr(SConfig::GetInstance().m_LocalCoreStartupParameter.theme_name));
|
||||
|
||||
// std::function = avoid error on msvc
|
||||
theme_selection->Bind(wxEVT_COMMAND_CHOICE_SELECTED, std::function<void(wxEvent&)>([theme_selection](wxEvent&)
|
||||
{
|
||||
SConfig::GetInstance().m_LocalCoreStartupParameter.theme_name = theme_selection->GetStringSelection();
|
||||
SConfig::GetInstance().m_LocalCoreStartupParameter.theme_name = WxStrToStr(theme_selection->GetStringSelection());
|
||||
main_frame->InitBitmaps();
|
||||
main_frame->UpdateGameList();
|
||||
}));
|
||||
|
@ -509,14 +509,7 @@ void CFrame::RecreateToolbar()
|
||||
|
||||
void CFrame::InitBitmaps()
|
||||
{
|
||||
std::string theme(SConfig::GetInstance().m_LocalCoreStartupParameter.theme_name + "/");
|
||||
std::string dir(File::GetUserPath(D_THEMES_IDX) + theme);
|
||||
|
||||
#if !defined(_WIN32)
|
||||
// If theme does not exist in user's dir load from shared directory
|
||||
if (!File::Exists(dir))
|
||||
dir = SHARED_USER_DIR THEMES_DIR "/" + theme;
|
||||
#endif
|
||||
auto const dir = StrToWxStr(File::GetThemeDir());
|
||||
|
||||
m_Bitmaps[Toolbar_FileOpen].LoadFile(dir + "open.png", wxBITMAP_TYPE_PNG);
|
||||
m_Bitmaps[Toolbar_Refresh].LoadFile(dir + "refresh.png", wxBITMAP_TYPE_PNG);
|
||||
|
@ -137,16 +137,8 @@ GameListItem::GameListItem(const std::string& _rFileName)
|
||||
}
|
||||
else
|
||||
{
|
||||
std::string theme = SConfig::GetInstance().m_LocalCoreStartupParameter.theme_name + "/";
|
||||
std::string dir = File::GetUserPath(D_THEMES_IDX) + theme;
|
||||
|
||||
#if !defined(_WIN32)
|
||||
// If theme does not exist in user's dir load from shared directory
|
||||
if (!File::Exists(dir))
|
||||
dir = SHARED_USER_DIR THEMES_DIR "/" + theme;
|
||||
#endif
|
||||
// default banner
|
||||
m_Image = wxImage(dir + "nobanner.png", wxBITMAP_TYPE_PNG);
|
||||
m_Image = wxImage(StrToWxStr(File::GetThemeDir()) + "nobanner.png", wxBITMAP_TYPE_PNG);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user