From 976c8309d9bd2acd888e779ae650023905112c38 Mon Sep 17 00:00:00 2001 From: Charles Dang Date: Fri, 20 Oct 2017 16:24:27 +1100 Subject: [PATCH] MP Lobby: minor cleanup * Removed some dead code. * Removed some unnecessary bound window references. * Removed some unnecessary code duplication. --- src/gui/dialogs/lobby/lobby.cpp | 23 ++++++++++------------- src/gui/dialogs/lobby/lobby.hpp | 4 ++-- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/src/gui/dialogs/lobby/lobby.cpp b/src/gui/dialogs/lobby/lobby.cpp index 919169db61217..f31916787db8d 100644 --- a/src/gui/dialogs/lobby/lobby.cpp +++ b/src/gui/dialogs/lobby/lobby.cpp @@ -318,7 +318,7 @@ void mp_lobby::update_gamelist_diff() } else { if(list_i >= gamelistbox_->get_item_count()) { ERR_LB << "Ran out of listbox items -- triggering a full refresh\n"; - network_connection_.send_data(config("refresh_lobby")); + refresh_lobby(); return; } @@ -327,7 +327,7 @@ void mp_lobby::update_gamelist_diff() << list_rows_deleted << " >= " << gamelist_id_at_row_.size() << " -- triggering a full refresh\n"; - network_connection_.send_data(config("refresh_lobby")); + refresh_lobby(); return; } @@ -335,7 +335,7 @@ void mp_lobby::update_gamelist_diff() if(game.id != listbox_game_id) { ERR_LB << "Listbox game id does not match expected id " << listbox_game_id << " " << game.id << " (row " << list_i << ")\n"; - network_connection_.send_data(config("refresh_lobby")); + refresh_lobby(); return; } @@ -547,7 +547,6 @@ void mp_lobby::update_playerlist() for(auto userptr : lobby_info_.users_sorted()) { mp::user_info& user = *userptr; sub_player_list* target_list(nullptr); - std::map data; std::string name = user.name; @@ -604,8 +603,6 @@ void mp_lobby::update_playerlist() } icon_ss << ".png"; - add_label_data(data, "player", name); - add_label_data(data, "main_icon", icon_ss.str()); if(!preferences::playerlist_group_players()) { target_list = &player_list_.other_rooms; @@ -674,7 +671,7 @@ void mp_lobby::pre_show(window& window) gamelistbox_ = find_widget(&window, "game_list", false, true); connect_signal_notify_modified(*gamelistbox_, - std::bind(&mp_lobby::gamelist_change_callback, this, std::ref(window))); + std::bind(&mp_lobby::gamelist_change_callback, this)); window.keyboard_capture(gamelistbox_); @@ -704,7 +701,7 @@ void mp_lobby::pre_show(window& window) connect_signal_mouse_left_click( find_widget