Changeset View
Changeset View
Standalone View
Standalone View
src/kxmlguiwindow.cpp
Show First 20 Lines • Show All 398 Lines • ▼ Show 20 Line(s) | 398 | { | |||
---|---|---|---|---|---|
399 | KXMLGUIBuilder::finalizeGUI(client); | 399 | KXMLGUIBuilder::finalizeGUI(client); | ||
400 | } | 400 | } | ||
401 | 401 | | |||
402 | void KXmlGuiWindow::checkAmbiguousShortcuts() | 402 | void KXmlGuiWindow::checkAmbiguousShortcuts() | ||
403 | { | 403 | { | ||
404 | QMap<QString, QAction*> shortcuts; | 404 | QMap<QString, QAction*> shortcuts; | ||
405 | QAction *editCutAction = actionCollection()->action(QStringLiteral("edit_cut")); | 405 | QAction *editCutAction = actionCollection()->action(QStringLiteral("edit_cut")); | ||
406 | QAction *deleteFileAction = actionCollection()->action(QStringLiteral("deletefile")); | 406 | QAction *deleteFileAction = actionCollection()->action(QStringLiteral("deletefile")); | ||
407 | foreach (QAction *action, actionCollection()->actions()) { | 407 | const auto actions = actionCollection()->actions(); | ||
408 | for (QAction *action : actions) { | ||||
408 | if (action->isEnabled()) { | 409 | if (action->isEnabled()) { | ||
409 | foreach (const QKeySequence &shortcut, action->shortcuts()) { | 410 | const auto actionShortcuts = action->shortcuts(); | ||
411 | for (const QKeySequence &shortcut : actionShortcuts) { | ||||
410 | if (shortcut.isEmpty()) { | 412 | if (shortcut.isEmpty()) { | ||
411 | continue; | 413 | continue; | ||
412 | } | 414 | } | ||
413 | const QString portableShortcutText = shortcut.toString(); | 415 | const QString portableShortcutText = shortcut.toString(); | ||
414 | const QAction *existingShortcutAction = shortcuts.value(portableShortcutText); | 416 | const QAction *existingShortcutAction = shortcuts.value(portableShortcutText); | ||
415 | if (existingShortcutAction) { | 417 | if (existingShortcutAction) { | ||
416 | // If the shortcut is already in use we give a warning, so that hopefully the developer will find it | 418 | // If the shortcut is already in use we give a warning, so that hopefully the developer will find it | ||
417 | // There is one exception, if the conflicting shortcut is a non primary shortcut of "edit_cut" | 419 | // There is one exception, if the conflicting shortcut is a non primary shortcut of "edit_cut" | ||
Show All 31 Lines |