From b25da12e9b218f7f22b0fbb8b21c8e1943c297de Mon Sep 17 00:00:00 2001 From: Rasmus Karlsson Date: Mon, 31 Jul 2017 01:26:14 +0200 Subject: [PATCH] reformat --- src/widgets/chatwidgetinput.cpp | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/widgets/chatwidgetinput.cpp b/src/widgets/chatwidgetinput.cpp index 6d9b67ded..3c3640304 100644 --- a/src/widgets/chatwidgetinput.cpp +++ b/src/widgets/chatwidgetinput.cpp @@ -60,25 +60,20 @@ ChatWidgetInput::ChatWidgetInput(ChatWidget *_chatWidget) c->sendMessage(textInput.toPlainText()); prevMsg.append(textInput.toPlainText()); event->accept(); - if(!(event->modifiers() == Qt::ControlModifier)) - { + if (!(event->modifiers() == Qt::ControlModifier)) { textInput.setText(QString()); prevIndex = 0; - } - else if(textInput.toPlainText() == prevMsg.at(prevMsg.size()-1)) - { + } else if (textInput.toPlainText() == prevMsg.at(prevMsg.size() - 1)) { prevMsg.removeLast(); } prevIndex = prevMsg.size(); - } - else if(event->key() == Qt::Key_Up){ - if(prevMsg.size() && prevIndex){ + } else if (event->key() == Qt::Key_Up) { + if (prevMsg.size() && prevIndex) { prevIndex--; textInput.setText(prevMsg.at(prevIndex)); } - } - else if(event->key() == Qt::Key_Down){ - if(prevIndex != (prevMsg.size() - 1) && prevIndex != prevMsg.size()){ + } else if (event->key() == Qt::Key_Down) { + if (prevIndex != (prevMsg.size() - 1) && prevIndex != prevMsg.size()) { prevIndex++; textInput.setText(prevMsg.at(prevIndex)); } else {