UI: use wxGetApp() instead of wxTheApp

This commit is contained in:
oltolm 2025-11-27 00:32:36 +01:00
parent 7330cdf3a9
commit 9a84b7f749
2 changed files with 7 additions and 7 deletions

View File

@ -1082,7 +1082,7 @@ uint32 GeneralSettings2::GetSelectedAccountPersistentId()
void GeneralSettings2::StoreConfig()
{
auto* app = (CemuApp*)wxTheApp;
auto& app = wxGetApp();
auto& config = GetConfig();
auto& wxGuiConfig = GetWxGUIConfig();
@ -1121,7 +1121,7 @@ void GeneralSettings2::StoreConfig()
else
{
const auto language = m_language->GetStringSelection();
for (const auto& lang : app->GetLanguages())
for (const auto& lang : app.GetLanguages())
{
if (lang->DescriptionNative == language)
{
@ -1841,8 +1841,8 @@ void GeneralSettings2::ApplyConfig()
m_game_paths->Append(wxString::FromUTF8(path));
}
const auto app = (CemuApp*)wxTheApp;
for (const auto& language : app->GetLanguages())
const auto& app = wxGetApp();
for (const auto& language : app.GetLanguages())
{
if (wxGUIconfig.language == language->Language)
{

View File

@ -75,13 +75,13 @@ wxPanel* GettingStartedDialog::CreatePage1()
GetConfig().language = wxLANGUAGE_DEFAULT;
else
{
auto* app = (CemuApp*)wxTheApp;
auto& app = wxGetApp();
const auto language = m_language->GetStringSelection();
for (const auto& lang : app->GetLanguages())
for (const auto& lang : app.GetLanguages())
{
if (lang->DescriptionNative == language)
{
app->LocalizeUI(static_cast<wxLanguage>(lang->Language));
app.LocalizeUI(static_cast<wxLanguage>(lang->Language));
wxCommandEvent event(EVT_REFRESH_FIRST_PAGE);
wxPostEvent(this, event);
break;