Commit 36861ec3 authored by Halla Rempt's avatar Halla Rempt
Browse files

Remove the shortcuts from the mdi window's system menu's actions

Just changing the scope isn't enough: people also want to be
able to configure the the close window action. Fortunately,
that turns out to be quite possible.

CCBUG:398729
BUG:375524
BUG:352205
parent dd218288
......@@ -2097,20 +2097,20 @@ void KisMainWindow::subWindowActivated()
}
/**
* Qt has a weirdness, it has a hardcoded shortcut added to an action
* in the window menu. We cannot change or remove it, so we should
* just disable our own shortcut in case it conflicts with the hardcoded
* shortcut.
* Qt has a weirdness, it has hardcoded shortcuts added to an action
* in the window menu. We need to reset the shortcuts for that menu
* to nothing, otherwise the shortcuts cannot be made configurable.
*
* See: https://bugs.kde.org/show_bug.cgi?id=352205
* https://bugs.kde.org/show_bug.cgi?id=375524
* https://bugs.kde.org/show_bug.cgi?id=398729
*/
d->close->setShortcutContext(Qt::WindowShortcut);
QMdiSubWindow *subWindow = d->mdiArea->currentSubWindow();
if (subWindow) {
QMenu *menu = subWindow->systemMenu();
if (menu) {
Q_FOREACH (QAction *action, menu->actions()) {
if (action->shortcut() == d->close->shortcut()) {
d->close->setShortcutContext(Qt::WidgetShortcut);
}
action->setShortcut(QKeySequence());
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment