forked from qt-creator/qt-creator
Terminal: Fix assert
ShortCutMap::addShortCut did assert if the keysequence was empty. Changed Q_ASSERT to QTC_ASSERT to not crash. Change-Id: Ib03e21bb00ab989e00d5c3de68b52b84c6eb2360 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -262,10 +262,12 @@ void TerminalWidget::registerShortcut(Command *cmd)
|
||||
QTC_ASSERT(cmd, return);
|
||||
auto addShortCut = [this, cmd] {
|
||||
for (const auto &keySequence : cmd->keySequences()) {
|
||||
m_shortcutMap.addShortcut(cmd->action(),
|
||||
keySequence,
|
||||
Qt::ShortcutContext::WindowShortcut,
|
||||
contextMatcher);
|
||||
if (!keySequence.isEmpty()) {
|
||||
m_shortcutMap.addShortcut(cmd->action(),
|
||||
keySequence,
|
||||
Qt::ShortcutContext::WindowShortcut,
|
||||
contextMatcher);
|
||||
}
|
||||
}
|
||||
};
|
||||
auto removeShortCut = [this, cmd] { m_shortcutMap.removeShortcut(0, cmd->action()); };
|
||||
|
||||
Reference in New Issue
Block a user