MCPcopy Create free account
hub / github.com/Codeya-IDE/deepin-ide / clear

Method clear

src/common/actionmanager/actioncontainer.cpp:227–247  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

225}
226
227void ActionContainer::clear()
228{
229 for (Group &group : d->groupList) {
230 for (QObject *item : std::as_const(group.items)) {
231 if (auto command = qobject_cast<Command *>(item)) {
232 removeAction(command);
233 disconnect(command, &Command::activeStateChanged,
234 d, &ActionContainerPrivate::scheduleUpdate);
235 disconnect(command, &QObject::destroyed, d, &ActionContainerPrivate::itemDestroyed);
236 } else if (auto container = qobject_cast<ActionContainer *>(item)) {
237 container->clear();
238 disconnect(container, &QObject::destroyed,
239 d, &ActionContainerPrivate::itemDestroyed);
240 removeMenu(container);
241 }
242 }
243 group.items.clear();
244 }
245
246 d->scheduleUpdate();
247}
248
249QAction *ActionContainer::actionForItem(QObject *item) const
250{

Callers 1

updateContainerMethod · 0.45

Calls 1

scheduleUpdateMethod · 0.80

Tested by

no test coverage detected