diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 25e59807e..4d0f85d5a 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -59,6 +59,8 @@ MainWindow::MainWindow() // the directory ('konsole') is included in the path here so that the XML // file can be found when this code is being used in the Konsole part. setXMLFile("konsole/konsoleui.rc"); + + actionCollection()->setAssociatedWidget(this); setupActions(); // create view manager @@ -81,13 +83,6 @@ MainWindow::MainWindow() // replace standard shortcuts which cannot be used in a terminal // (as they are reserved for use by terminal programs) correctShortcuts(); - - // add all actions to this window, so that the keyboard shortcuts can be - // used even when the menu is hidden - // - // See comments in SessionController constructor about Qt 4 behaviour with - // hidden menu bars and shortcuts - addActions(actionCollection()->actions()); } void MainWindow::correctShortcuts() diff --git a/src/SessionController.cpp b/src/SessionController.cpp index 796f8c215..7d166757b 100644 --- a/src/SessionController.cpp +++ b/src/SessionController.cpp @@ -85,18 +85,9 @@ SessionController::SessionController(Session* session , TerminalDisplay* view, Q // handle user interface related to session (menus etc.) setXMLFile("konsole/sessionui.rc"); + actionCollection()->setAssociatedWidget(view); setupActions(); - // add all actions to this window, so that the keyboard shortcuts can be - // used even when the main window's menu is hidden - // - // TODO: The Qt-4 behaviour of shortcuts not working when the menu bar is hidden - // affects other KDE applications as well. A kdelibs fix might be possible. - // - // See discussion: - // http://lists.kde.org/?l=konsole-devel&m=118529209602516&w=2 - view->addActions(actionCollection()->actions()); - setIdentifier(_session->sessionId()); sessionTitleChanged();