void LayoutManager::addMenu(IMenu& menu) { dynamicMenus_.push_back(&menu); auto window = getWindow(menu.windowId()); if (window == nullptr) { return; } for (auto actionIt = actions_.begin(); actionIt != actions_.end(); ++actionIt) { auto action = actionIt->action_; if (getWindow(action->windowId()) != window) { continue; } for (auto& path : action->paths()) { if (matchMenu(menu, path.c_str())) { menu.addAction(*action, path.c_str()); actionIt->menus_.insert(&menu); } } } }
void ClassMenuItemAdder::addAction(IMenu& menu, const char* text, int index) { menu.addAction(text, MENU_DISABLED); }