From f2aa1ddea6d7c37cbc47bd3be52e959410eb7ba9 Mon Sep 17 00:00:00 2001 From: hiker Date: Thu, 5 Nov 2015 07:55:59 +1100 Subject: [PATCH] Code cleanup. --- src/states_screens/online_screen.cpp | 1 - src/states_screens/server_selection.cpp | 10 +++++----- src/states_screens/server_selection.hpp | 1 - 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/states_screens/online_screen.cpp b/src/states_screens/online_screen.cpp index 62abefd38..61fe5b4b2 100644 --- a/src/states_screens/online_screen.cpp +++ b/src/states_screens/online_screen.cpp @@ -256,7 +256,6 @@ void OnlineScreen::eventCallback(Widget* widget, const std::string& name, { STKHost::setIsLAN(); ServerSelection::getInstance()->push(); - // TODO: find lan server; } else if (selection == m_manage_user->m_properties[PROP_ID]) { diff --git a/src/states_screens/server_selection.cpp b/src/states_screens/server_selection.cpp index 15e0ce6e8..1ebfac1d0 100644 --- a/src/states_screens/server_selection.cpp +++ b/src/states_screens/server_selection.cpp @@ -79,8 +79,6 @@ void ServerSelection::refresh() */ void ServerSelection::loadedFromFile() { - m_back_widget = getWidget("back"); - assert(m_back_widget != NULL); m_reload_widget = getWidget("reload"); assert(m_reload_widget != NULL); m_server_list_widget = getWidget("server_list"); @@ -172,10 +170,12 @@ void ServerSelection::eventCallback( GUIEngine::Widget* widget, else if (name == m_server_list_widget->m_properties[GUIEngine::PROP_ID]) { int selected_index = m_server_list_widget->getSelectionID(); - uint32_t server_id = ServersManager::get()->getServerBySort(selected_index)->getServerId(); - uint32_t host_id = ServersManager::get()->getServerBySort(selected_index)->getHostId(); + const Server *server = + ServersManager::get()->getServerBySort(selected_index); + uint32_t server_id = server->getServerId(); + uint32_t host_id = server->getHostId(); new ServerInfoDialog(server_id, host_id); - } + } // click on server } // eventCallback diff --git a/src/states_screens/server_selection.hpp b/src/states_screens/server_selection.hpp index 079dc25aa..140613407 100644 --- a/src/states_screens/server_selection.hpp +++ b/src/states_screens/server_selection.hpp @@ -38,7 +38,6 @@ private: ServerSelection(); ~ServerSelection(); - GUIEngine::IconButtonWidget * m_back_widget; GUIEngine::IconButtonWidget * m_reload_widget; GUIEngine::LabelWidget * m_update_status; GUIEngine::ListWidget * m_server_list_widget;