tpreferences: fixed phantom entry remaining after removing last acquaintance from list

This commit is contained in:
Charles Dang 2016-02-15 07:46:33 +11:00
parent f4c3d97f55
commit 0537fc2391

View file

@ -297,6 +297,9 @@ void tpreferences::setup_friends_list(twindow& window)
find_widget<tbutton>(&window, "remove", false).set_active(!acquaintances.empty());
friends_list.clear();
friend_names_.clear();
if (acquaintances.empty()) {
data["friend_icon"]["label"] = "misc/status-neutral.png";
data["friend_name"]["label"] = _("Empty list");
@ -305,9 +308,6 @@ void tpreferences::setup_friends_list(twindow& window)
return;
}
friends_list.clear();
friend_names_.clear();
FOREACH(const AUTO& acquaintence, acquaintances)
{
std::string image = "friend.png";