From e78b8402fac084f40ae82a86060820b8ea0c17a3 Mon Sep 17 00:00:00 2001 From: uramer Date: Fri, 28 Jan 2022 21:45:13 +0100 Subject: [PATCH] Fix warnings --- apps/openmw/mwgui/settingswindow.cpp | 7 ++++--- apps/openmw/mwgui/settingswindow.hpp | 4 ++-- components/lua_ui/scriptsettings.cpp | 2 +- components/lua_ui/scriptsettings.hpp | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/apps/openmw/mwgui/settingswindow.cpp b/apps/openmw/mwgui/settingswindow.cpp index 3ea60b92bb..f5d35bc13f 100644 --- a/apps/openmw/mwgui/settingswindow.cpp +++ b/apps/openmw/mwgui/settingswindow.cpp @@ -729,7 +729,8 @@ namespace MWGui void SettingsWindow::renderScriptSettings() { - LuaUi::attachToWidget(mCurrentPage); + if (mCurrentPage >= 0) + LuaUi::attachToWidget(mCurrentPage); mCurrentPage = -1; mScriptList->removeAllItems(); mScriptView->setCanvasSize({0, 0}); @@ -756,12 +757,12 @@ namespace MWGui mScriptBox->setVisible(!disabled); } - void SettingsWindow::onScriptFilterChange(MyGUI::Widget*) + void SettingsWindow::onScriptFilterChange(MyGUI::EditBox*) { renderScriptSettings(); } - void SettingsWindow::onScriptListSelection(MyGUI::Widget*, size_t index) + void SettingsWindow::onScriptListSelection(MyGUI::ListBox*, size_t index) { if (mCurrentPage >= 0) LuaUi::attachToWidget(mCurrentPage); diff --git a/apps/openmw/mwgui/settingswindow.hpp b/apps/openmw/mwgui/settingswindow.hpp index 2db8f2e19c..ff86c96f60 100644 --- a/apps/openmw/mwgui/settingswindow.hpp +++ b/apps/openmw/mwgui/settingswindow.hpp @@ -78,8 +78,8 @@ namespace MWGui void onWindowResize(MyGUI::Window* _sender); - void onScriptFilterChange(MyGUI::Widget*); - void onScriptListSelection(MyGUI::Widget*, size_t index); + void onScriptFilterChange(MyGUI::EditBox*); + void onScriptListSelection(MyGUI::ListBox*, size_t index); void apply(); diff --git a/components/lua_ui/scriptsettings.cpp b/components/lua_ui/scriptsettings.cpp index c8a7d849c9..1bc93f4e84 100644 --- a/components/lua_ui/scriptsettings.cpp +++ b/components/lua_ui/scriptsettings.cpp @@ -28,7 +28,7 @@ namespace LuaUi void attachToWidget(size_t index, MyGUI::Widget* widget) { - if (0 <= index && index < allSettings.size()) + if (index < allSettings.size()) allSettings[index].mElement->attachToWidget(widget); } } diff --git a/components/lua_ui/scriptsettings.hpp b/components/lua_ui/scriptsettings.hpp index b13bfc578c..7075a3b189 100644 --- a/components/lua_ui/scriptsettings.hpp +++ b/components/lua_ui/scriptsettings.hpp @@ -9,7 +9,7 @@ namespace LuaUi { - class Element; + struct Element; struct ScriptSettings { std::string mName;