1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

dont clear msg everytime

This commit is contained in:
agilob 2015-01-26 00:51:17 +00:00
parent c9e96300b2
commit 6989346f41
No known key found for this signature in database
GPG Key ID: 34568050DBCCB997

View File

@ -41,7 +41,8 @@ void ChatTextEdit::keyPressEvent(QKeyEvent * event)
*/
else if (key == Qt::Key_Up && this->toPlainText().isEmpty())
this->setText(lastMessage);
else if (key == Qt::Key_Up && !this->toPlainText().isEmpty())
else if (key == Qt::Key_Up && !this->toPlainText().isEmpty()
&& lastMessage != this->toPlainText())
{
currentMessage = this->toPlainText();
this->setText(lastMessage);
@ -51,8 +52,6 @@ void ChatTextEdit::keyPressEvent(QKeyEvent * event)
this->setPlainText(currentMessage);
currentMessage.clear();
}
else if (key == Qt::Key_Down)
this->clear();
else
{
emit keyPressed();