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