From 24bfdd36540f54ffc559bc87ea0b97534a87d713 Mon Sep 17 00:00:00 2001 From: imn Date: Thu, 1 Oct 2015 17:01:20 +0300 Subject: [PATCH] Additional fix for the INT PAL '52621: Module's shortcuts are enabled even when module is not active' issue. --- src/CAM/CAM_Module.cxx | 9 ++++----- src/CAM/CAM_Module.h | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/CAM/CAM_Module.cxx b/src/CAM/CAM_Module.cxx index d3a0ddaf1..5ad1dad48 100755 --- a/src/CAM/CAM_Module.cxx +++ b/src/CAM/CAM_Module.cxx @@ -234,11 +234,10 @@ bool CAM_Module::activateModule( SUIT_Study* /*study*/ ) { // IMN 05/03/2015: we copied myActionMap for reset/unset actions accelerator keys // after activate/deactivate modules - for ( QMap, QKeySequence>::Iterator it = myActionShortcutMap.begin(); it != myActionShortcutMap.end(); ++it ) + for ( QMap::Iterator it = myActionShortcutMap.begin(); it != myActionShortcutMap.end(); ++it ) { - myActionMap.insert( it.key().first, it.key().second ); // Reset actions accelerator keys - it.key().second->setShortcut( it.value() ); + it.key()->setShortcut( it.value() ); } myActionShortcutMap.clear(); return true; @@ -263,9 +262,9 @@ bool CAM_Module::deactivateModule( SUIT_Study* ) myActionShortcutMap.clear(); for ( QMap::Iterator it = myActionMap.begin(); it != myActionMap.end(); ++it ) { - myActionShortcutMap.insert( qMakePair( it.key(), it.value() ), it.value()->shortcut() ); + myActionShortcutMap.insert( it.value(), it.value()->shortcut() ); + it.value()->setShortcut( QKeySequence() ); } - myActionMap.clear(); return true; } diff --git a/src/CAM/CAM_Module.h b/src/CAM/CAM_Module.h index 952f18571..69c541505 100755 --- a/src/CAM/CAM_Module.h +++ b/src/CAM/CAM_Module.h @@ -143,7 +143,7 @@ protected: bool unregisterAction( QAction* ); // IMN 05/03/2015: we copied myActionMap for reset/unset actions accelerator keys // after activate/deactivate modules - QMap, QKeySequence> myActionShortcutMap; //!< copy actions shortcut map + QMap myActionShortcutMap; //!< copy actions shortcut map virtual bool abortAllOperations(); -- 2.39.2