Skip to content
Permalink
Browse files

Fix cannot set shortcut for zoom in (fix #14958)

  • Loading branch information
nyalldawson committed Jun 7, 2016
1 parent a8cf02a commit f8f3b21b643ed90b9c3a9d94e76f4073d688234e
Showing with 14 additions and 2 deletions.
  1. +1 −1 src/app/qgisapp.cpp
  2. +13 −1 src/gui/qgsshortcutsmanager.cpp
@@ -1009,7 +1009,7 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, bool skipVersionCh
//also make ctrl+alt+= a shortcut to switch to zoom in map tool
QShortcut* zoomInToolShortCut = new QShortcut( QKeySequence( tr( "Ctrl+Alt+=" ) ), this );
connect( zoomInToolShortCut, SIGNAL( activated() ), this, SLOT( zoomIn() ) );
zoomInToolShortCut->setObjectName( "Zoom in" );
zoomInToolShortCut->setObjectName( "ZoomIn2" );
zoomInToolShortCut->setWhatsThis( "Zoom in (secondary)" );

// Show a nice tip of the day
@@ -14,7 +14,7 @@
***************************************************************************/

#include "qgsshortcutsmanager.h"

#include "qgslogger.h"
#include <QSettings>
#include <QShortcut>

@@ -86,6 +86,12 @@ void QgsShortcutsManager::registerAllChildShortcuts( QObject* object, bool recur

bool QgsShortcutsManager::registerAction( QAction* action, const QString& defaultSequence )
{
#ifdef QGISDEBUG
// if using a debug build, warn on duplicate actions
if ( actionByName( action->text() ) || shortcutByName( action->text() ) )
QgsLogger::warning( QString( "Duplicate shortcut registered: %1" ).arg( action->text() ) );
#endif

mActions.insert( action, defaultSequence );
connect( action, SIGNAL( destroyed() ), this, SLOT( actionDestroyed() ) );

@@ -103,6 +109,12 @@ bool QgsShortcutsManager::registerAction( QAction* action, const QString& defaul

bool QgsShortcutsManager::registerShortcut( QShortcut* shortcut, const QString& defaultSequence )
{
#ifdef QGISDEBUG
// if using a debug build, warn on duplicate actions
if ( actionByName( shortcut->objectName() ) || shortcutByName( shortcut->objectName() ) )
QgsLogger::warning( QString( "Duplicate shortcut registered: %1" ).arg( shortcut->objectName() ) );
#endif

mShortcuts.insert( shortcut, defaultSequence );
connect( shortcut, SIGNAL( destroyed() ), this, SLOT( shortcutDestroyed() ) );

0 comments on commit f8f3b21

Please sign in to comment.
You can’t perform that action at this time.