Commit 6b5f1ee7 authored by Dominik Haumann's avatar Dominik Haumann
Browse files

Merge branch 'release/19.12'

This merge contains the crash fix for ESC in the external tools plugin
parents c8e04248 5aa3b009
......@@ -160,12 +160,7 @@ KateExternalToolsPluginView::KateExternalToolsPluginView(KTextEditor::MainWindow
mainWindow->guiFactory()->addClient(this);
// ESC should close & hide ToolView
connect(m_mainWindow, &KTextEditor::MainWindow::unhandledShortcutOverride, [this](QEvent *event) {
auto keyEvent = static_cast<QKeyEvent *>(event);
if (keyEvent->key() == Qt::Key_Escape && keyEvent->modifiers() == Qt::NoModifier) {
deleteToolView();
}
});
connect(m_mainWindow, &KTextEditor::MainWindow::unhandledShortcutOverride, this, &KateExternalToolsPluginView::handleEsc);
}
KateExternalToolsPluginView::~KateExternalToolsPluginView()
......@@ -266,6 +261,15 @@ void KateExternalToolsPluginView::deleteToolView()
m_toolView = nullptr;
}
}
void KateExternalToolsPluginView::handleEsc(QEvent *event)
{
auto keyEvent = dynamic_cast<QKeyEvent *>(event);
if (keyEvent && keyEvent->key() == Qt::Key_Escape && keyEvent->modifiers() == Qt::NoModifier) {
deleteToolView();
}
}
// END KateExternalToolsPluginView
// kate: space-indent on; indent-width 4; replace-tabs on;
......@@ -142,6 +142,11 @@ public Q_SLOTS:
*/
void deleteToolView();
/**
* On Escape, hide tool view.
*/
void handleEsc(QEvent *event);
private:
KateExternalToolsPlugin *m_plugin;
KTextEditor::MainWindow *m_mainWindow;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment