forked from qt-creator/qt-creator
QmlDesigner.ShortcutManager: Fix CLANG static analysis warnings
Change-Id: I9600439e1236c52b347c667bac6b6d79e2335375 Reviewed-by: Tobias Hunger <tobias.hunger@digia.com> Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
This commit is contained in:
@@ -115,36 +115,36 @@ void ShortCutManager::registerActions(const Core::Context &qmlDesignerMainContex
|
|||||||
|
|
||||||
//Edit Menu
|
//Edit Menu
|
||||||
|
|
||||||
command = Core::ActionManager::registerAction(&m_deleteAction, QmlDesigner::Constants::C_BACKSPACE, qmlDesignerFormEditorContext);
|
Core::ActionManager::registerAction(&m_deleteAction, QmlDesigner::Constants::C_BACKSPACE, qmlDesignerFormEditorContext);
|
||||||
command = Core::ActionManager::registerAction(&m_deleteAction, QmlDesigner::Constants::C_BACKSPACE, qmlDesignerNavigatorContext);
|
command = Core::ActionManager::registerAction(&m_deleteAction, QmlDesigner::Constants::C_BACKSPACE, qmlDesignerNavigatorContext);
|
||||||
command->setDefaultKeySequence(QKeySequence(Qt::Key_Backspace));
|
command->setDefaultKeySequence(QKeySequence(Qt::Key_Backspace));
|
||||||
command->setAttribute(Core::Command::CA_Hide); // don't show delete in other modes
|
command->setAttribute(Core::Command::CA_Hide); // don't show delete in other modes
|
||||||
if (Utils::HostOsInfo::isMacHost())
|
if (Utils::HostOsInfo::isMacHost())
|
||||||
editMenu->addAction(command, Core::Constants::G_EDIT_COPYPASTE);
|
editMenu->addAction(command, Core::Constants::G_EDIT_COPYPASTE);
|
||||||
|
|
||||||
command = Core::ActionManager::registerAction(&m_deleteAction, QmlDesigner::Constants::C_DELETE, qmlDesignerFormEditorContext);
|
Core::ActionManager::registerAction(&m_deleteAction, QmlDesigner::Constants::C_DELETE, qmlDesignerFormEditorContext);
|
||||||
command = Core::ActionManager::registerAction(&m_deleteAction, QmlDesigner::Constants::C_DELETE, qmlDesignerNavigatorContext);
|
command = Core::ActionManager::registerAction(&m_deleteAction, QmlDesigner::Constants::C_DELETE, qmlDesignerNavigatorContext);
|
||||||
command->setDefaultKeySequence(QKeySequence::Delete);
|
command->setDefaultKeySequence(QKeySequence::Delete);
|
||||||
command->setAttribute(Core::Command::CA_Hide); // don't show delete in other modes
|
command->setAttribute(Core::Command::CA_Hide); // don't show delete in other modes
|
||||||
if (!Utils::HostOsInfo::isMacHost())
|
if (!Utils::HostOsInfo::isMacHost())
|
||||||
editMenu->addAction(command, Core::Constants::G_EDIT_COPYPASTE);
|
editMenu->addAction(command, Core::Constants::G_EDIT_COPYPASTE);
|
||||||
|
|
||||||
command = Core::ActionManager::registerAction(&m_cutAction, Core::Constants::CUT, qmlDesignerFormEditorContext);
|
Core::ActionManager::registerAction(&m_cutAction, Core::Constants::CUT, qmlDesignerFormEditorContext);
|
||||||
command = Core::ActionManager::registerAction(&m_cutAction, Core::Constants::CUT, qmlDesignerNavigatorContext);
|
command = Core::ActionManager::registerAction(&m_cutAction, Core::Constants::CUT, qmlDesignerNavigatorContext);
|
||||||
command->setDefaultKeySequence(QKeySequence::Cut);
|
command->setDefaultKeySequence(QKeySequence::Cut);
|
||||||
editMenu->addAction(command, Core::Constants::G_EDIT_COPYPASTE);
|
editMenu->addAction(command, Core::Constants::G_EDIT_COPYPASTE);
|
||||||
|
|
||||||
command = Core::ActionManager::registerAction(&m_copyAction, Core::Constants::COPY, qmlDesignerFormEditorContext);
|
Core::ActionManager::registerAction(&m_copyAction, Core::Constants::COPY, qmlDesignerFormEditorContext);
|
||||||
command = Core::ActionManager::registerAction(&m_copyAction, Core::Constants::COPY, qmlDesignerNavigatorContext);
|
command = Core::ActionManager::registerAction(&m_copyAction, Core::Constants::COPY, qmlDesignerNavigatorContext);
|
||||||
command->setDefaultKeySequence(QKeySequence::Copy);
|
command->setDefaultKeySequence(QKeySequence::Copy);
|
||||||
editMenu->addAction(command, Core::Constants::G_EDIT_COPYPASTE);
|
editMenu->addAction(command, Core::Constants::G_EDIT_COPYPASTE);
|
||||||
|
|
||||||
command = Core::ActionManager::registerAction(&m_pasteAction, Core::Constants::PASTE, qmlDesignerFormEditorContext);
|
Core::ActionManager::registerAction(&m_pasteAction, Core::Constants::PASTE, qmlDesignerFormEditorContext);
|
||||||
command = Core::ActionManager::registerAction(&m_pasteAction, Core::Constants::PASTE, qmlDesignerNavigatorContext);
|
command = Core::ActionManager::registerAction(&m_pasteAction, Core::Constants::PASTE, qmlDesignerNavigatorContext);
|
||||||
command->setDefaultKeySequence(QKeySequence::Paste);
|
command->setDefaultKeySequence(QKeySequence::Paste);
|
||||||
editMenu->addAction(command, Core::Constants::G_EDIT_COPYPASTE);
|
editMenu->addAction(command, Core::Constants::G_EDIT_COPYPASTE);
|
||||||
|
|
||||||
command = Core::ActionManager::registerAction(&m_selectAllAction, Core::Constants::SELECTALL, qmlDesignerFormEditorContext);
|
Core::ActionManager::registerAction(&m_selectAllAction, Core::Constants::SELECTALL, qmlDesignerFormEditorContext);
|
||||||
command = Core::ActionManager::registerAction(&m_selectAllAction, Core::Constants::SELECTALL, qmlDesignerNavigatorContext);
|
command = Core::ActionManager::registerAction(&m_selectAllAction, Core::Constants::SELECTALL, qmlDesignerNavigatorContext);
|
||||||
|
|
||||||
command->setDefaultKeySequence(QKeySequence::SelectAll);
|
command->setDefaultKeySequence(QKeySequence::SelectAll);
|
||||||
@@ -166,7 +166,7 @@ void ShortCutManager::registerActions(const Core::Context &qmlDesignerMainContex
|
|||||||
command->setAttribute(Core::Command::CA_Hide);
|
command->setAttribute(Core::Command::CA_Hide);
|
||||||
viewsMenu->addAction(command);
|
viewsMenu->addAction(command);
|
||||||
|
|
||||||
command = Core::ActionManager::registerAction(&m_hideSidebarsAction, Core::Constants::TOGGLE_SIDEBAR, qmlDesignerMainContext);
|
Core::ActionManager::registerAction(&m_hideSidebarsAction, Core::Constants::TOGGLE_SIDEBAR, qmlDesignerMainContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShortCutManager::updateActions(Core::IEditor* currentEditor)
|
void ShortCutManager::updateActions(Core::IEditor* currentEditor)
|
||||||
|
|||||||
Reference in New Issue
Block a user