X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fuisupport%2Finputline.cpp;h=501ee605e41ff8f5f663c2fe57ccb2b4b1845a72;hb=d4f83534f995dcc59ee50c57bb18521452310ba0;hp=48ffa0a3292cae528f6da3422e474ecd0cb4361b;hpb=914118e3b22cdd91191aea8568130f831db0cb8d;p=quassel.git diff --git a/src/uisupport/inputline.cpp b/src/uisupport/inputline.cpp index 48ffa0a3..501ee605 100644 --- a/src/uisupport/inputline.cpp +++ b/src/uisupport/inputline.cpp @@ -162,20 +162,22 @@ bool InputLine::addToHistory(const QString &text, bool temporary) { Q_ASSERT(0 <= idx && idx <= history.count()); - if(history.isEmpty() || text != history[idx - (int)(idx == history.count())]) { + if(temporary) { // if an entry of the history is changed, we remember it and show it again at this // position until a line was actually sent // sent lines get appended to the history - if(temporary) { + if(history.isEmpty() || text != history[idx - (int)(idx == history.count())]) { tempHistory[idx] = text; - } else { + return true; + } + } else { + if(history.isEmpty() || text != history.last()) { history << text; tempHistory.clear(); + return true; } - return true; - } else { - return false; } + return false; } void InputLine::on_returnPressed() { @@ -220,8 +222,10 @@ void InputLine::on_textChanged(QString newText) { #ifdef Q_WS_MAC question.setWindowFlags(question.windowFlags() | Qt::Sheet); // Qt::Sheet is not ignored on other platforms as it should :/ #endif - if(question.exec() == QMessageBox::No) + if(question.exec() == QMessageBox::No) { + clear(); return; + } } foreach(QString line, lines) {