Commit 7f2af0da authored by Kurt Hindenburg's avatar Kurt Hindenburg

Partial revert of "Allow view-controlling keys in read-only mode"

This reverts the Ctrl+S/Q/C not sending to a read-only/locked session.
This portion is causing tests to fail on ASAN; which might be the tests
fault, but for now revert.

(cherry picked from commit 1f2128ea)
parent b94162c1
......@@ -37,7 +37,6 @@
// Konsole
#include "KeyboardTranslator.h"
#include "SessionController.h"
#include "TerminalDisplay.h"
using Konsole::Vt102Emulation;
......@@ -1043,9 +1042,6 @@ void Vt102Emulation::sendKeyEvent(QKeyEvent *event)
const Qt::KeyboardModifiers modifiers = event->modifiers();
KeyboardTranslator::States states = KeyboardTranslator::NoState;
TerminalDisplay * currentView = _currentScreen->currentTerminalDisplay();
const bool isReadOnly = currentView->sessionController()->isReadOnly();
// get current states
if (getMode(MODE_NewLine)) {
states |= KeyboardTranslator::NewLineState;
......@@ -1063,18 +1059,16 @@ void Vt102Emulation::sendKeyEvent(QKeyEvent *event)
states |= KeyboardTranslator::ApplicationKeypadState;
}
if (!isReadOnly) {
// check flow control state
if ((modifiers &Qt::ControlModifier) != 0u) {
switch (event->key()) {
case Qt::Key_S:
emit flowControlKeyPressed(true);
break;
case Qt::Key_Q:
case Qt::Key_C: // cancel flow control
emit flowControlKeyPressed(false);
break;
}
// check flow control state
if ((modifiers &Qt::ControlModifier) != 0u) {
switch (event->key()) {
case Qt::Key_S:
emit flowControlKeyPressed(true);
break;
case Qt::Key_Q:
case Qt::Key_C: // cancel flow control
emit flowControlKeyPressed(false);
break;
}
}
......@@ -1110,6 +1104,8 @@ void Vt102Emulation::sendKeyEvent(QKeyEvent *event)
if ( entry.command() != KeyboardTranslator::NoCommand )
{
TerminalDisplay * currentView = _currentScreen->currentTerminalDisplay();
if ((entry.command() & KeyboardTranslator::EraseCommand) != 0) {
textToSend += eraseChar();
} else if ((entry.command() & KeyboardTranslator::ScrollPageUpCommand) != 0) {
......@@ -1132,10 +1128,8 @@ void Vt102Emulation::sendKeyEvent(QKeyEvent *event)
textToSend += _codec->fromUnicode(event->text());
}
if (!isReadOnly) {
emit sendData(textToSend);
}
} else if (!isReadOnly) {
emit sendData(textToSend);
} else {
// print an error message to the terminal if no key translator has been
// set
QString translatorError = i18n("No keyboard translator available. "
......
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