From 15b1c1c8123ab3bb0abe40956b2e19084ab1fe35 Mon Sep 17 00:00:00 2001 From: Jekyll Wu Date: Thu, 13 Oct 2011 16:12:34 +0800 Subject: [PATCH] Simplify the code for setting up shortcuts --- src/ViewManager.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/ViewManager.cpp b/src/ViewManager.cpp index 7d89e307b..abc1bde0c 100644 --- a/src/ViewManager.cpp +++ b/src/ViewManager.cpp @@ -235,15 +235,11 @@ void ViewManager::setupActions() } // keyboard shortcut only actions - KShortcut nextViewShortcut = nextViewAction->shortcut(); - nextViewShortcut.setPrimary( QKeySequence(Qt::SHIFT+Qt::Key_Right) ); - nextViewAction->setShortcut(nextViewShortcut); + nextViewAction->setShortcut( QKeySequence(Qt::SHIFT+Qt::Key_Right) ); connect( nextViewAction, SIGNAL(triggered()) , this , SLOT(nextView()) ); _viewSplitter->addAction(nextViewAction); - KShortcut previousViewShortcut = previousViewAction->shortcut(); - previousViewShortcut.setPrimary( QKeySequence(Qt::SHIFT+Qt::Key_Left) ); - previousViewAction->setShortcut(previousViewShortcut); + previousViewAction->setShortcut( QKeySequence(Qt::SHIFT+Qt::Key_Left) ); connect( previousViewAction, SIGNAL(triggered()) , this , SLOT(previousView()) ); _viewSplitter->addAction(previousViewAction); @@ -254,6 +250,7 @@ void ViewManager::setupActions() moveViewLeftAction->setShortcut( QKeySequence(Qt::CTRL+Qt::SHIFT+Qt::Key_Left) ); connect( moveViewLeftAction , SIGNAL(triggered()) , this , SLOT(moveActiveViewLeft()) ); _viewSplitter->addAction(moveViewLeftAction); + moveViewRightAction->setShortcut( QKeySequence(Qt::CTRL+Qt::SHIFT+Qt::Key_Right) ); connect( moveViewRightAction , SIGNAL(triggered()) , this , SLOT(moveActiveViewRight()) ); _viewSplitter->addAction(moveViewRightAction);