Changeset View
Changeset View
Standalone View
Standalone View
src/kactioncollection.cpp
Show First 20 Lines • Show All 336 Lines • ▼ Show 20 Line(s) | 276 | #endif | |||
---|---|---|---|---|---|
337 | } | 337 | } | ||
338 | 338 | | |||
339 | if (d->connectTriggered) { | 339 | if (d->connectTriggered) { | ||
340 | connect(action, &QAction::triggered, | 340 | connect(action, &QAction::triggered, | ||
341 | this, &KActionCollection::slotActionTriggered); | 341 | this, &KActionCollection::slotActionTriggered); | ||
342 | } | 342 | } | ||
343 | 343 | | |||
344 | emit inserted(action); | 344 | emit inserted(action); | ||
345 | emit changed(); | ||||
345 | return action; | 346 | return action; | ||
346 | } | 347 | } | ||
347 | 348 | | |||
348 | void KActionCollection::addActions(const QList<QAction *> &actions) | 349 | void KActionCollection::addActions(const QList<QAction *> &actions) | ||
349 | { | 350 | { | ||
350 | for (QAction *action : actions) { | 351 | for (QAction *action : actions) { | ||
351 | addAction(action->objectName(), action); | 352 | addAction(action->objectName(), action); | ||
352 | } | 353 | } | ||
Show All 15 Lines | 368 | for (QWidget *widget : qAsConst(d->associatedWidgets)) { | |||
368 | widget->removeAction(action); | 369 | widget->removeAction(action); | ||
369 | } | 370 | } | ||
370 | 371 | | |||
371 | action->disconnect(this); | 372 | action->disconnect(this); | ||
372 | 373 | | |||
373 | #if KXMLGUI_BUILD_DEPRECATED_SINCE(5, 0) | 374 | #if KXMLGUI_BUILD_DEPRECATED_SINCE(5, 0) | ||
374 | emit removed(action); //deprecated | 375 | emit removed(action); //deprecated | ||
375 | #endif | 376 | #endif | ||
377 | emit changed(); | ||||
376 | return action; | 378 | return action; | ||
377 | } | 379 | } | ||
378 | 380 | | |||
379 | QAction *KActionCollection::addAction(KStandardAction::StandardAction actionType, const QObject *receiver, const char *member) | 381 | QAction *KActionCollection::addAction(KStandardAction::StandardAction actionType, const QObject *receiver, const char *member) | ||
380 | { | 382 | { | ||
381 | QAction *action = KStandardAction::create(actionType, receiver, member, this); | 383 | QAction *action = KStandardAction::create(actionType, receiver, member, this); | ||
382 | return action; | 384 | return action; | ||
383 | } | 385 | } | ||
▲ Show 20 Lines • Show All 374 Lines • ▼ Show 20 Line(s) | 755 | { | |||
758 | if (!unlistAction(action)) { | 760 | if (!unlistAction(action)) { | ||
759 | return; | 761 | return; | ||
760 | } | 762 | } | ||
761 | 763 | | |||
762 | //HACK the object we emit is partly destroyed | 764 | //HACK the object we emit is partly destroyed | ||
763 | #if KXMLGUI_BUILD_DEPRECATED_SINCE(5, 0) | 765 | #if KXMLGUI_BUILD_DEPRECATED_SINCE(5, 0) | ||
764 | emit q->removed(action); //deprecated. remove in KDE5 | 766 | emit q->removed(action); //deprecated. remove in KDE5 | ||
765 | #endif | 767 | #endif | ||
768 | emit q->changed(); | ||||
766 | } | 769 | } | ||
767 | 770 | | |||
768 | void KActionCollection::connectNotify(const QMetaMethod &signal) | 771 | void KActionCollection::connectNotify(const QMetaMethod &signal) | ||
769 | { | 772 | { | ||
770 | if (d->connectHovered && d->connectTriggered) { | 773 | if (d->connectHovered && d->connectTriggered) { | ||
771 | return; | 774 | return; | ||
772 | } | 775 | } | ||
773 | 776 | | |||
▲ Show 20 Lines • Show All 116 Lines • Show Last 20 Lines |