Removed unnecessary variable.

This commit is contained in:
hiker 2015-10-09 09:43:50 +11:00
parent d687d17bfe
commit 92f18d03dc
4 changed files with 6 additions and 17 deletions

View File

@ -38,7 +38,6 @@ DEFINE_SCREEN_SINGLETON( OnlineUserSearch );
OnlineUserSearch::OnlineUserSearch() : Screen("online/user_search.stkgui")
{
m_selected_index = -1;
m_search_request = NULL;
m_search_string = "";
m_last_search_string = "";
@ -226,9 +225,9 @@ void OnlineUserSearch::eventCallback(GUIEngine::Widget* widget,
}
else if (name == m_user_list_widget->m_properties[GUIEngine::PROP_ID])
{
m_selected_index = m_user_list_widget->getSelectionID();
if (m_selected_index != -1)
new UserInfoDialog(m_users[m_selected_index]);
int selected_index = m_user_list_widget->getSelectionID();
if (selected_index != -1)
new UserInfoDialog(m_users[selected_index]);
}
else if (name == m_search_button_widget->m_properties[GUIEngine::PROP_ID])
{

View File

@ -48,9 +48,6 @@ private:
/** Pointer to the result list. */
GUIEngine::ListWidget * m_user_list_widget;
/** The currently selected index, used to re-select this item after
* addons_loading is being displayed. */
int m_selected_index;
/** Seach string entered in the search widget. */
irr::core::stringw m_search_string;
/** Last search string, used to avoid doing the same search again. */

View File

@ -36,9 +36,7 @@ DEFINE_SCREEN_SINGLETON( ServerSelection );
ServerSelection::ServerSelection() : Screen("online/server_selection.stkgui")
{
m_selected_index = -1;
m_refresh_request = NULL;
} // ServerSelection
// ----------------------------------------------------------------------------
@ -159,9 +157,9 @@ void ServerSelection::eventCallback( GUIEngine::Widget* widget,
else if (name == m_server_list_widget->m_properties[GUIEngine::PROP_ID])
{
m_selected_index = m_server_list_widget->getSelectionID();
uint32_t server_id = ServersManager::get()->getServerBySort(m_selected_index)->getServerId();
uint32_t host_id = ServersManager::get()->getServerBySort(m_selected_index)->getHostId();
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();
new ServerInfoDialog(server_id, host_id);
}

View File

@ -43,11 +43,6 @@ private:
GUIEngine::LabelWidget * m_update_status;
GUIEngine::ListWidget * m_server_list_widget;
/** The currently selected index, used to re-select this item after
* addons_loading is being displayed. */
int m_selected_index;
/** \brief To check (and set) if sort order is descending **/
bool m_sort_desc;