From f3ac812e2079eac53c1a9db56541d7103bd14a61 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 21 Feb 2016 19:30:40 +0300 Subject: Fix code style. --- src/gui/windows/chatwindow.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/gui/windows/chatwindow.cpp') diff --git a/src/gui/windows/chatwindow.cpp b/src/gui/windows/chatwindow.cpp index d5c2677ac..6066170d2 100644 --- a/src/gui/windows/chatwindow.cpp +++ b/src/gui/windows/chatwindow.cpp @@ -803,11 +803,12 @@ void ChatWindow::keyPressed(KeyEvent &event) else if (actionId == InputAction::GUI_INSERT && !mChatInput->getText().empty()) { + const std::string str = mChatInput->getText(); // Add the current message to the history and clear the text - if (mHistory.empty() || mChatInput->getText() != mHistory.back()) - mHistory.push_back(mChatInput->getText()); + if (mHistory.empty() || str != mHistory.back()) + mHistory.push_back(str); mCurHist = mHistory.end(); - mChatInput->setText(""); + mChatInput->setText(std::string()); } else if (actionId == InputAction::GUI_TAB && !mChatInput->getText().empty()) -- cgit v1.2.3-60-g2f50