Changeset View
Changeset View
Standalone View
Standalone View
src/kkeysequencewidget.cpp
Show First 20 Lines • Show All 404 Lines • ▼ Show 20 Line(s) | 392 | Q_FOREACH (QAction *stealAction, d->stealActions) { | |||
---|---|---|---|---|---|
405 | } | 405 | } | ||
406 | 406 | | |||
407 | // Remember the changed collection | 407 | // Remember the changed collection | ||
408 | if (parentCollection) { | 408 | if (parentCollection) { | ||
409 | changedCollections.insert(parentCollection); | 409 | changedCollections.insert(parentCollection); | ||
410 | } | 410 | } | ||
411 | } | 411 | } | ||
412 | 412 | | |||
413 | Q_FOREACH (KActionCollection *col, changedCollections) { | 413 | for (KActionCollection *col : qAsConst(changedCollections)) { | ||
414 | col->writeSettings(); | 414 | col->writeSettings(); | ||
415 | } | 415 | } | ||
416 | 416 | | |||
417 | d->stealActions.clear(); | 417 | d->stealActions.clear(); | ||
418 | } | 418 | } | ||
419 | 419 | | |||
420 | void KKeySequenceWidgetPrivate::startRecording() | 420 | void KKeySequenceWidgetPrivate::startRecording() | ||
421 | { | 421 | { | ||
▲ Show 20 Lines • Show All 141 Lines • ▼ Show 20 Line(s) | 533 | { | |||
563 | // | 563 | // | ||
564 | // Example 3: | 564 | // Example 3: | ||
565 | // | 565 | // | ||
566 | // Some weird combination of Example 1 and 2 with three shortcuts using | 566 | // Some weird combination of Example 1 and 2 with three shortcuts using | ||
567 | // 1/2/3 key shortcuts. I think you can imagine. | 567 | // 1/2/3 key shortcuts. I think you can imagine. | ||
568 | QList<QAction *> conflictingActions; | 568 | QList<QAction *> conflictingActions; | ||
569 | 569 | | |||
570 | //find conflicting shortcuts with existing actions | 570 | //find conflicting shortcuts with existing actions | ||
571 | foreach (QAction *qaction, allActions) { | 571 | for (QAction *qaction : qAsConst(allActions)) { | ||
572 | if (shortcutsConflictWith(qaction->shortcuts(), keySequence)) { | 572 | if (shortcutsConflictWith(qaction->shortcuts(), keySequence)) { | ||
573 | // A conflict with a KAction. If that action is configurable | 573 | // A conflict with a KAction. If that action is configurable | ||
574 | // ask the user what to do. If not reject this keySequence. | 574 | // ask the user what to do. If not reject this keySequence. | ||
575 | if (checkActionCollections.first()->isShortcutsConfigurable(qaction)) { | 575 | if (checkActionCollections.first()->isShortcutsConfigurable(qaction)) { | ||
576 | conflictingActions.append(qaction); | 576 | conflictingActions.append(qaction); | ||
577 | } else { | 577 | } else { | ||
578 | wontStealShortcut(qaction, keySequence); | 578 | wontStealShortcut(qaction, keySequence); | ||
579 | return true; | 579 | return true; | ||
▲ Show 20 Lines • Show All 281 Lines • Show Last 20 Lines |