From eb95e63d94f69d59ed7ebcdca25a09403e320186 Mon Sep 17 00:00:00 2001 From: oltolm Date: Sun, 23 Nov 2025 11:51:44 +0100 Subject: [PATCH] UI: Fix warnings (#1729) --- src/gui/wxgui/AudioDebuggerWindow.cpp | 2 +- src/gui/wxgui/CemuApp.cpp | 2 +- src/gui/wxgui/MainWindow.cpp | 6 ++--- src/gui/wxgui/MemorySearcherTool.cpp | 2 +- src/gui/wxgui/components/wxGameList.cpp | 24 +++++++++---------- src/gui/wxgui/components/wxGameList.h | 4 ++-- src/gui/wxgui/debugger/BreakpointWindow.cpp | 4 ++-- src/gui/wxgui/input/HotkeySettings.cpp | 4 ++-- .../DebugPPCThreadsWindow.cpp | 4 ++-- .../TextureRelationWindow.cpp | 2 +- src/gui/wxgui/wxcomponents/checktree.cpp | 16 ++++++------- 11 files changed, 35 insertions(+), 35 deletions(-) diff --git a/src/gui/wxgui/AudioDebuggerWindow.cpp b/src/gui/wxgui/AudioDebuggerWindow.cpp index d570e84b..ef1122a2 100644 --- a/src/gui/wxgui/AudioDebuggerWindow.cpp +++ b/src/gui/wxgui/AudioDebuggerWindow.cpp @@ -124,7 +124,7 @@ AudioDebuggerWindow::AudioDebuggerWindow(wxFrame& parent) sizer->Add(voiceListbox, 1, wxEXPAND | wxBOTTOM, 0); - voiceListbox->Connect(wxEVT_RIGHT_DOWN, wxMouseEventHandler(AudioDebuggerWindow::OnVoiceListRightClick), NULL, this); + voiceListbox->Bind(wxEVT_RIGHT_DOWN, &AudioDebuggerWindow::OnVoiceListRightClick, this); mainPane->SetSizer(sizer); diff --git a/src/gui/wxgui/CemuApp.cpp b/src/gui/wxgui/CemuApp.cpp index 17d8e577..574ff810 100644 --- a/src/gui/wxgui/CemuApp.cpp +++ b/src/gui/wxgui/CemuApp.cpp @@ -63,7 +63,7 @@ void unused_translation_dummy() } #if BOOST_OS_WINDOWS -#include +#include fs::path GetAppDataRoamingPath() { PWSTR path = nullptr; diff --git a/src/gui/wxgui/MainWindow.cpp b/src/gui/wxgui/MainWindow.cpp index c17bdb03..cf06cc3e 100644 --- a/src/gui/wxgui/MainWindow.cpp +++ b/src/gui/wxgui/MainWindow.cpp @@ -867,7 +867,7 @@ void MainWindow::OpenSettings() const bool mlc_modified = frame.MLCModified(); if (paths_modified) - m_game_list->ReloadGameEntries(false); + m_game_list->ReloadGameEntries(); else SaveSettings(); @@ -1012,7 +1012,7 @@ void MainWindow::OnConsoleLanguage(wxCommandEvent& event) if (m_game_list) { m_game_list->DeleteCachedStrings(); - m_game_list->ReloadGameEntries(false); + m_game_list->ReloadGameEntries(); } GetConfigHandle().Save(); } @@ -1450,7 +1450,7 @@ void MainWindow::OnAccountListRefresh(wxCommandEvent& event) void MainWindow::OnRequestGameListRefresh(wxCommandEvent& event) { - m_game_list->ReloadGameEntries(false); + m_game_list->ReloadGameEntries(); } void MainWindow::OnSetWindowTitle(wxCommandEvent& event) diff --git a/src/gui/wxgui/MemorySearcherTool.cpp b/src/gui/wxgui/MemorySearcherTool.cpp index cc99fb8b..75f756c7 100644 --- a/src/gui/wxgui/MemorySearcherTool.cpp +++ b/src/gui/wxgui/MemorySearcherTool.cpp @@ -382,7 +382,7 @@ void MemorySearcherTool::OnEntryListRightClick(wxDataViewEvent& event) //mnu.SetClientData(data); mnu.Append(LIST_ENTRY_ADD, _("&Add new entry"))->Enable(false); mnu.Append(LIST_ENTRY_REMOVE, _("&Remove entry")); - mnu.Connect(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MemorySearcherTool::OnPopupClick), nullptr, this); + mnu.Bind(wxEVT_COMMAND_MENU_SELECTED, &MemorySearcherTool::OnPopupClick, this); PopupMenu(&mnu); } diff --git a/src/gui/wxgui/components/wxGameList.cpp b/src/gui/wxgui/components/wxGameList.cpp index ae0de6c7..fff9b81e 100644 --- a/src/gui/wxgui/components/wxGameList.cpp +++ b/src/gui/wxgui/components/wxGameList.cpp @@ -66,21 +66,21 @@ void _stripPathFilename(fs::path& path) path = path.parent_path(); } -std::list _getCachesPaths(const TitleId& titleId) +std::vector _getCachesPaths(const TitleId& titleId) { - std::list cachePaths{ + std::vector cachePaths{ ActiveSettings::GetCachePath(L"shaderCache/driver/vk/{:016x}.bin", titleId), ActiveSettings::GetCachePath(L"shaderCache/precompiled/{:016x}_spirv.bin", titleId), ActiveSettings::GetCachePath(L"shaderCache/precompiled/{:016x}_gl.bin", titleId), ActiveSettings::GetCachePath(L"shaderCache/transferable/{:016x}_shaders.bin", titleId), ActiveSettings::GetCachePath(L"shaderCache/transferable/{:016x}_vkpipeline.bin", titleId)}; - cachePaths.remove_if( - [](const fs::path& cachePath) - { - std::error_code ec; - return !fs::exists(cachePath, ec); - }); + cachePaths.erase(std::remove_if(cachePaths.begin(), cachePaths.end(), + [](const fs::path& cachePath) { + std::error_code ec; + return !fs::exists(cachePath, ec); + }), + cachePaths.end()); return cachePaths; } @@ -342,7 +342,7 @@ bool wxGameList::IsVisible(long item) const return visible; } -void wxGameList::ReloadGameEntries(bool cached) +void wxGameList::ReloadGameEntries() { wxWindowUpdateLocker windowlock(this); DeleteAllItems(); @@ -842,7 +842,7 @@ void wxGameList::OnContextMenuSelected(wxCommandEvent& event) switch (event.GetId()) { case kContextMenuRefreshGames: - ReloadGameEntries(false); + ReloadGameEntries(); break; case kContextMenuStyleList: SetStyle(Style::kList); @@ -1255,7 +1255,7 @@ void wxGameList::HandleTitleListCallback(CafeTitleListCallbackEvent* evt) } } -void wxGameList::RemoveCache(const std::list& cachePaths, const std::string& titleName) +void wxGameList::RemoveCache(const std::vector& cachePaths, const std::string& titleName) { wxMessageDialog dialog(this, formatWxString(_("Remove the shader caches for {}?"), titleName), _("Remove shader caches"), wxCENTRE | wxYES_NO | wxICON_EXCLAMATION); dialog.SetYesNoLabels(_("Yes"), _("No")); @@ -1263,7 +1263,7 @@ void wxGameList::RemoveCache(const std::list& cachePaths, const std::s const auto dialogResult = dialog.ShowModal(); if (dialogResult != wxID_YES) return; - std::list errs; + std::vector errs; for (const fs::path& cachePath : cachePaths) { if (std::error_code ec; !fs::remove(cachePath, ec)) diff --git a/src/gui/wxgui/components/wxGameList.h b/src/gui/wxgui/components/wxGameList.h index 50bd4034..3c5fdedd 100644 --- a/src/gui/wxgui/components/wxGameList.h +++ b/src/gui/wxgui/components/wxGameList.h @@ -51,7 +51,7 @@ public: void SaveConfig(bool flush = false); bool IsVisible(long item) const; // only available in wxwidgets 3.1.3 - void ReloadGameEntries(bool cached = false); + void ReloadGameEntries(); void DeleteCachedStrings(); void CreateShortcut(GameInfo2& gameInfo); @@ -115,7 +115,7 @@ private: void HandleTitleListCallback(struct CafeTitleListCallbackEvent* evt); - void RemoveCache(const std::list& cachePath, const std::string& titleName); + void RemoveCache(const std::vector& cachePath, const std::string& titleName); void AsyncWorkerThread(); void RequestLoadIconAsync(TitleId titleId); diff --git a/src/gui/wxgui/debugger/BreakpointWindow.cpp b/src/gui/wxgui/debugger/BreakpointWindow.cpp index 7c4b1556..63d5a733 100644 --- a/src/gui/wxgui/debugger/BreakpointWindow.cpp +++ b/src/gui/wxgui/debugger/BreakpointWindow.cpp @@ -223,7 +223,7 @@ void BreakpointWindow::OnRightDown(wxMouseEvent& event) menu.Append(MENU_ID_CREATE_MEM_BP_READ, _("Create memory breakpoint (read)")); menu.Append(MENU_ID_CREATE_MEM_BP_WRITE, _("Create memory breakpoint (write)")); - menu.Connect(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(BreakpointWindow::OnContextMenuClick), nullptr, this); + menu.Bind(wxEVT_COMMAND_MENU_SELECTED, &BreakpointWindow::OnContextMenuClick, this); PopupMenu(&menu); } else @@ -234,7 +234,7 @@ void BreakpointWindow::OnRightDown(wxMouseEvent& event) wxMenu menu; menu.Append(MENU_ID_DELETE_BP, _("Delete breakpoint")); - menu.Connect(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(BreakpointWindow::OnContextMenuClickSelected), nullptr, this); + menu.Bind(wxEVT_COMMAND_MENU_SELECTED, &BreakpointWindow::OnContextMenuClickSelected, this); PopupMenu(&menu); } } diff --git a/src/gui/wxgui/input/HotkeySettings.cpp b/src/gui/wxgui/input/HotkeySettings.cpp index 195061d7..0bf59025 100644 --- a/src/gui/wxgui/input/HotkeySettings.cpp +++ b/src/gui/wxgui/input/HotkeySettings.cpp @@ -239,8 +239,8 @@ void HotkeySettings::CreateHotkeyRow(const wxString& label, sHotkeyCfg& cfgHotke controllerInput->Bind(wxEVT_BUTTON, &HotkeySettings::OnControllerHotkeyInputLeftClick, this); /* for cancelling and clearing input */ - keyInput->Connect(wxEVT_RIGHT_UP, wxMouseEventHandler(HotkeySettings::OnKeyboardHotkeyInputRightClick), NULL, this); - controllerInput->Connect(wxEVT_RIGHT_UP, wxMouseEventHandler(HotkeySettings::OnControllerHotkeyInputRightClick), NULL, this); + keyInput->Bind(wxEVT_RIGHT_UP, &HotkeySettings::OnKeyboardHotkeyInputRightClick, this); + controllerInput->Bind(wxEVT_RIGHT_UP, &HotkeySettings::OnControllerHotkeyInputRightClick, this); keyInput->SetMinSize(m_minButtonSize); controllerInput->SetMinSize(m_minButtonSize); diff --git a/src/gui/wxgui/windows/PPCThreadsViewer/DebugPPCThreadsWindow.cpp b/src/gui/wxgui/windows/PPCThreadsViewer/DebugPPCThreadsWindow.cpp index 323eda39..ae1ea971 100644 --- a/src/gui/wxgui/windows/PPCThreadsViewer/DebugPPCThreadsWindow.cpp +++ b/src/gui/wxgui/windows/PPCThreadsViewer/DebugPPCThreadsWindow.cpp @@ -124,7 +124,7 @@ DebugPPCThreadsWindow::DebugPPCThreadsWindow(wxFrame& parent) sizer->Add(row, 0, wxEXPAND | wxALL, 5); - m_thread_list->Connect(wxEVT_RIGHT_DOWN, wxMouseEventHandler(DebugPPCThreadsWindow::OnThreadListRightClick), nullptr, this); + m_thread_list->Bind(wxEVT_RIGHT_DOWN, &DebugPPCThreadsWindow::OnThreadListRightClick, this); SetSizer(sizer); @@ -466,7 +466,7 @@ void DebugPPCThreadsWindow::OnThreadListRightClick(wxMouseEvent& event) menu.AppendSeparator(); menu.Append(THREADLIST_MENU_DUMP_STACK_TRACE, _("Write stack trace to log")); menu.Append(THREADLIST_MENU_PROFILE_THREAD, _("Profile thread")); - menu.Connect(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(DebugPPCThreadsWindow::OnThreadListPopupClick), nullptr, this); + menu.Bind(wxEVT_COMMAND_MENU_SELECTED, &DebugPPCThreadsWindow::OnThreadListPopupClick, this); PopupMenu(&menu); } diff --git a/src/gui/wxgui/windows/TextureRelationViewer/TextureRelationWindow.cpp b/src/gui/wxgui/windows/TextureRelationViewer/TextureRelationWindow.cpp index d0169ab0..cc1e3321 100644 --- a/src/gui/wxgui/windows/TextureRelationViewer/TextureRelationWindow.cpp +++ b/src/gui/wxgui/windows/TextureRelationViewer/TextureRelationWindow.cpp @@ -124,7 +124,7 @@ TextureRelationViewerWindow::TextureRelationViewerWindow(wxFrame& parent) sizerBottom->Add(checkboxShowViews, 0, wxALIGN_CENTER_VERTICAL | wxBOTTOM | wxTOP | wxLEFT, 10); checkboxShowViews->SetValue(true); - textureRelationListA->Connect(wxEVT_RIGHT_DOWN, wxMouseEventHandler(TextureRelationViewerWindow::OnTextureListRightClick), NULL, this); + textureRelationListA->Bind(wxEVT_RIGHT_DOWN, &TextureRelationViewerWindow::OnTextureListRightClick, this); sizer->Add( sizerBottom, diff --git a/src/gui/wxgui/wxcomponents/checktree.cpp b/src/gui/wxgui/wxcomponents/checktree.cpp index e368fa6a..d7d56b69 100644 --- a/src/gui/wxgui/wxcomponents/checktree.cpp +++ b/src/gui/wxgui/wxcomponents/checktree.cpp @@ -121,49 +121,49 @@ void wxCheckTree::Init() // Unchecked renderer_dc.SelectObject(unchecked_bmp); - renderer_dc.SetBackground(*wxTheBrushList->FindOrCreateBrush(GetBackgroundColour(), wxSOLID)); + renderer_dc.SetBackground(*wxTheBrushList->FindOrCreateBrush(GetBackgroundColour())); renderer_dc.Clear(); wxRendererNative::Get().DrawCheckBox(this, renderer_dc, wxRect(0, 0, width, height), wxCONTROL_NONE); // Unchecked Mouse Over renderer_dc.SelectObject(unchecked_mouse_over_bmp); - renderer_dc.SetBackground(*wxTheBrushList->FindOrCreateBrush(GetBackgroundColour(), wxSOLID)); + renderer_dc.SetBackground(*wxTheBrushList->FindOrCreateBrush(GetBackgroundColour())); renderer_dc.Clear(); wxRendererNative::Get().DrawCheckBox(this, renderer_dc, wxRect(0, 0, width, height), wxCONTROL_CURRENT); // Unchecked and Disabled renderer_dc.SelectObject(unchecked_disabled_bmp); - renderer_dc.SetBackground(*wxTheBrushList->FindOrCreateBrush(GetBackgroundColour(), wxSOLID)); + renderer_dc.SetBackground(*wxTheBrushList->FindOrCreateBrush(GetBackgroundColour())); renderer_dc.Clear(); wxRendererNative::Get().DrawCheckBox(this, renderer_dc, wxRect(0, 0, width, height), wxCONTROL_DISABLED); // Unchecked Left Down renderer_dc.SelectObject(unchecked_left_down_bmp); - renderer_dc.SetBackground(*wxTheBrushList->FindOrCreateBrush(GetBackgroundColour(), wxSOLID)); + renderer_dc.SetBackground(*wxTheBrushList->FindOrCreateBrush(GetBackgroundColour())); renderer_dc.Clear(); wxRendererNative::Get().DrawCheckBox(this, renderer_dc, wxRect(0, 0, width, height), wxCONTROL_CURRENT | wxCONTROL_PRESSED); // Checked renderer_dc.SelectObject(checked_bmp); - renderer_dc.SetBackground(*wxTheBrushList->FindOrCreateBrush(GetBackgroundColour(), wxSOLID)); + renderer_dc.SetBackground(*wxTheBrushList->FindOrCreateBrush(GetBackgroundColour())); renderer_dc.Clear(); wxRendererNative::Get().DrawCheckBox(this, renderer_dc, wxRect(0, 0, width, height), wxCONTROL_CHECKED); // Checked Mouse Over renderer_dc.SelectObject(checked_mouse_over_bmp); - renderer_dc.SetBackground(*wxTheBrushList->FindOrCreateBrush(GetBackgroundColour(), wxSOLID)); + renderer_dc.SetBackground(*wxTheBrushList->FindOrCreateBrush(GetBackgroundColour())); renderer_dc.Clear(); wxRendererNative::Get().DrawCheckBox(this, renderer_dc, wxRect(0, 0, width, height), wxCONTROL_CHECKED | wxCONTROL_CURRENT); // Checked Left Down renderer_dc.SelectObject(checked_left_down_bmp); - renderer_dc.SetBackground(*wxTheBrushList->FindOrCreateBrush(GetBackgroundColour(), wxSOLID)); + renderer_dc.SetBackground(*wxTheBrushList->FindOrCreateBrush(GetBackgroundColour())); renderer_dc.Clear(); wxRendererNative::Get().DrawCheckBox(this, renderer_dc, wxRect(0, 0, width, height), wxCONTROL_CHECKED | wxCONTROL_CURRENT | wxCONTROL_PRESSED); // Checked and Disabled renderer_dc.SelectObject(checked_disabled_bmp); - renderer_dc.SetBackground(*wxTheBrushList->FindOrCreateBrush(GetBackgroundColour(), wxSOLID)); + renderer_dc.SetBackground(*wxTheBrushList->FindOrCreateBrush(GetBackgroundColour())); renderer_dc.Clear(); wxRendererNative::Get().DrawCheckBox(this, renderer_dc, wxRect(0, 0, width, height), wxCONTROL_CHECKED | wxCONTROL_DISABLED);