reset typeahead when adding/removing items in the menu

This commit is contained in:
Mark Tiefenbruck 2008-05-30 02:02:41 -07:00
parent 5119ded374
commit 85a44db6c6

View file

@ -243,6 +243,8 @@ int Menu::remove(unsigned int index) {
MenuItem *item = (*it);
if (item) {
if (!m_matches.empty())
resetTypeAhead();
menuitems.erase(it);
// avoid O(n^2) algorithm with removeAll()
if (index != menuitems.size())
@ -511,6 +513,7 @@ void Menu::show() {
updateMenu();
m_type_ahead.reset();
m_matches.clear();
menu.window.showSubwindows();
menu.window.show();