[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [dragon/frameworks] src/app: fix shortcut warnings
From:       Lukáš Tinkl <lukas () kde ! org>
Date:       2014-11-30 21:33:29
Message-ID: E1XvC7V-000485-K7 () scm ! kde ! org
[Download RAW message or body]

Git commit 89750bbe3f8a361032051261388b1ab94fb7f695 by Lukáš Tinkl.
Committed on 30/11/2014 at 21:33.
Pushed by lukas into branch 'frameworks'.

fix shortcut warnings

M  +2    -2    src/app/actions.cpp
M  +11   -11   src/app/mainWindow.cpp

http://commits.kde.org/dragon/89750bbe3f8a361032051261388b1ab94fb7f695

diff --git a/src/app/actions.cpp b/src/app/actions.cpp
index d480773..3ce044d 100644
--- a/src/app/actions.cpp
+++ b/src/app/actions.cpp
@@ -37,7 +37,7 @@ Dragon::PlayAction::PlayAction( QObject *receiver, const char \
                *slot, KActionColl
     setInactiveGuiItem(KGuiItem(i18n("Play"), \
                QStringLiteral("media-playback-start")));
     setActiveGuiItem(KGuiItem(i18n("Pause"), QStringLiteral( \
"media-playback-pause")));  setAutoToggle( false );
-    setShortcut( Qt::Key_Space );
+    ac->setDefaultShortcut(this, Qt::Key_Space);
     ac->addAction( objectName(), this );
     connect( this, SIGNAL(triggered(bool)), receiver, slot );
 }
@@ -55,7 +55,7 @@ Dragon::VolumeAction::VolumeAction( QObject *receiver, const char \
*slot, KAction  {
     setObjectName( QLatin1String( "volume" ) );
     setIcon( QIcon::fromTheme(QLatin1String( "player-volume" ) ) );
-    setShortcut( Qt::Key_V );
+    ac->setDefaultShortcut(this, Qt::Key_V);
     ac->addAction( objectName(), this );
     connect( this, SIGNAL(triggered(bool)), receiver, slot );
     connect( engine(), SIGNAL(mutedChanged(bool)), this, SLOT(mutedChanged(bool)) );
diff --git a/src/app/mainWindow.cpp b/src/app/mainWindow.cpp
index a8788b2..0f5ffbf 100644
--- a/src/app/mainWindow.cpp
+++ b/src/app/mainWindow.cpp
@@ -276,7 +276,7 @@ MainWindow::setupActions()
 
     KToggleFullScreenAction* toggleFullScreen = new KToggleFullScreenAction( this, \
ac );  toggleFullScreen->setObjectName( QLatin1String( "fullscreen" ) );
-    toggleFullScreen->setShortcut( Qt::Key_F );
+    ac->setDefaultShortcuts(toggleFullScreen, QList<QKeySequence>() << Qt::Key_F << \
KStandardShortcut::fullScreen());  toggleFullScreen->setAutoRepeat( false );
     connect( toggleFullScreen, SIGNAL(toggled(bool)), Dragon::mainWindow(), \
SLOT(setFullScreen(bool)) );  addToAc( toggleFullScreen );
@@ -301,25 +301,25 @@ MainWindow::setupActions()
 
     QAction* playerStop = new QAction( QIcon::fromTheme(QLatin1String( \
"media-playback-stop" )), i18n("Stop"), ac );  playerStop->setObjectName( \
                QLatin1String( "stop" ) );
-    playerStop->setShortcut( Qt::Key_S );
+    ac->setDefaultShortcut(playerStop, Qt::Key_S);
     connect( playerStop, SIGNAL(triggered()), this, SLOT(stop()) );
     addToAc( playerStop )
 
     KToggleAction* mute = new KToggleAction( QIcon::fromTheme(QLatin1String( \
"player-volume-muted" )), i18nc( "Mute the sound output", "Mute"), ac );  \
                mute->setObjectName( QLatin1String( "mute" ) );
-    mute->setShortcut( Qt::Key_M );
+    ac->setDefaultShortcut(mute, Qt::Key_M);
     connect( mute, SIGNAL(toggled(bool)), videoWindow(), SLOT(mute(bool)) );
     addToAc( mute )
 
     QAction* resetZoom = new QAction( QIcon::fromTheme(QLatin1String( \
"zoom-fit-best" )), i18n("Reset Video Scale"), ac );  resetZoom->setObjectName( \
                QLatin1String( "reset_zoom" ) );
-    resetZoom->setShortcut( Qt::Key_Equal );
+    ac->setDefaultShortcut(resetZoom, Qt::Key_Equal);
     connect( resetZoom, SIGNAL(triggered()), videoWindow(), SLOT(resetZoom()) );
     addToAc( resetZoom )
 
     QAction* dvdMenu = new QAction( QIcon::fromTheme(QLatin1String( \
"media-optical-video" )), i18n("Menu Toggle"), ac );  dvdMenu->setObjectName( \
                QLatin1String( "toggle_dvd_menu" ) );
-    dvdMenu->setShortcut( Qt::Key_R );
+    ac->setDefaultShortcut(dvdMenu, Qt::Key_R);
     connect( dvdMenu, SIGNAL(triggered()), engine(), SLOT(toggleDVDMenu()) );
     addToAc( dvdMenu )
 
@@ -347,39 +347,39 @@ MainWindow::setupActions()
 
     QAction* prev_chapter = new QAction( QIcon::fromTheme(QLatin1String( \
"media-skip-backward" )), i18n("Previous Chapter"), ac );  \
                prev_chapter->setObjectName( QLatin1String( "prev_chapter" ) );
-    prev_chapter->setShortcut( Qt::Key_Comma );
+    ac->setDefaultShortcut(prev_chapter, Qt::Key_Comma);
     connect( prev_chapter, SIGNAL(triggered()), engine(), SLOT(prevChapter()) );
     addToAc( prev_chapter )
 
     QAction* next_chapter = new QAction( QIcon::fromTheme(QLatin1String( \
"media-skip-forward" )), i18n("Next Chapter"), ac );  next_chapter->setObjectName( \
                QLatin1String( "next_chapter" ) );
-    next_chapter->setShortcut( Qt::Key_Period );
+    ac->setDefaultShortcut(next_chapter, Qt::Key_Period);
     connect( next_chapter, SIGNAL(triggered()), engine(), SLOT(nextChapter()) );
     addToAc( next_chapter )
 
     // xgettext: no-c-format
     QAction* tenPercentBack = new QAction( QIcon::fromTheme(QLatin1String( \
"media-seek-backward" )), i18n("Return 10% Back"), ac );  \
                tenPercentBack->setObjectName( QLatin1String( "ten_percent_back" ) );
-    tenPercentBack->setShortcut( Qt::Key_PageUp );
+    ac->setDefaultShortcut(tenPercentBack, Qt::Key_PageUp);
     connect( tenPercentBack, SIGNAL(triggered()), engine(), SLOT(tenPercentBack()) \
);  addToAc( tenPercentBack )
 
     // xgettext: no-c-format
     QAction* tenPercentForward = new QAction( QIcon::fromTheme(QLatin1String( \
                "media-seek-forward" )), i18n("Go 10% Forward"), ac );
     tenPercentForward->setObjectName( QLatin1String( "ten_percent_forward" ) );
-    tenPercentForward->setShortcut( Qt::Key_PageDown );
+    ac->setDefaultShortcut(tenPercentForward, Qt::Key_PageDown);
     connect( tenPercentForward, SIGNAL(triggered()), engine(), \
SLOT(tenPercentForward()) );  addToAc( tenPercentForward )
 
     QAction* tenSecondsBack = new QAction( QIcon::fromTheme(QLatin1String( \
"media-seek-backward" )), i18n("Return 10 Seconds Back"), ac );  \
                tenSecondsBack->setObjectName( QLatin1String( "ten_seconds_back" ) );
-    tenSecondsBack->setShortcut( Qt::Key_Minus );
+    ac->setDefaultShortcut(tenSecondsBack, Qt::Key_Minus);
     connect( tenSecondsBack, SIGNAL(triggered()), engine(), SLOT(tenSecondsBack()) \
);  addToAc( tenSecondsBack )
 
     QAction* tenSecondsForward = new QAction( QIcon::fromTheme(QLatin1String( \
                "media-seek-forward" )), i18n("Go 10 Seconds Forward"), ac );
     tenSecondsForward->setObjectName( QLatin1String( "ten_seconds_forward" ) );
-    tenSecondsForward->setShortcut( Qt::Key_Plus );
+    ac->setDefaultShortcut(tenSecondsForward, Qt::Key_Plus);
     connect( tenSecondsForward, SIGNAL(triggered()), engine(), \
SLOT(tenSecondsForward()) );  addToAc( tenSecondsForward )
     #undef addToAc


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic