reset typeahead when adding/removing items in the menu
This commit is contained in:
parent
5119ded374
commit
85a44db6c6
1 changed files with 3 additions and 0 deletions
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue