From 663dfe5e9eb500dc9d3f7acd375f2e2feaf01884 Mon Sep 17 00:00:00 2001 From: Cranken Date: Mon, 24 Jul 2017 11:50:15 +0200 Subject: [PATCH] Disabled CTRL+Enter adding messages more than once. --- src/widgets/chatwidgetinput.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/widgets/chatwidgetinput.cpp b/src/widgets/chatwidgetinput.cpp index 1724dcd7c..6d9b67ded 100644 --- a/src/widgets/chatwidgetinput.cpp +++ b/src/widgets/chatwidgetinput.cpp @@ -57,7 +57,6 @@ ChatWidgetInput::ChatWidgetInput(ChatWidget *_chatWidget) if (c == nullptr) { return; } - c->sendMessage(textInput.toPlainText()); prevMsg.append(textInput.toPlainText()); event->accept(); @@ -66,9 +65,9 @@ ChatWidgetInput::ChatWidgetInput(ChatWidget *_chatWidget) textInput.setText(QString()); prevIndex = 0; } - else if(textInput.toPlainText() == prevMsg.at(1)) + else if(textInput.toPlainText() == prevMsg.at(prevMsg.size()-1)) { - prevMsg.removeFirst(); + prevMsg.removeLast(); } prevIndex = prevMsg.size(); }