X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fuisupport%2Finputline.cpp;h=f9c8a651c37375d06fe658bcbd778d9fe49b0c23;hb=9905ef8d4e5af6bb38368e7d694b6e1ccc09e21c;hp=3fe70c7153f7288baa41170963310c5c982dd5ec;hpb=b19c2a813430ea8030dc66eb3343c727c2124db9;p=quassel.git diff --git a/src/uisupport/inputline.cpp b/src/uisupport/inputline.cpp index 3fe70c71..f9c8a651 100644 --- a/src/uisupport/inputline.cpp +++ b/src/uisupport/inputline.cpp @@ -130,9 +130,9 @@ void InputLine::keyPressEvent(QKeyEvent * event) { #ifdef HAVE_KDE //Since this is a ktextedit, we don't have this signal "natively" case Qt::Key_Return: + case Qt::Key_Enter: event->accept(); - if(!text().isEmpty()) - emit returnPressed(); + emit returnPressed(); break; #endif @@ -169,9 +169,11 @@ bool InputLine::addToHistory(const QString &text, bool temporary) { } void InputLine::on_returnPressed() { - addToHistory(text()); - emit sendText(text()); - resetLine(); + if(!text().isEmpty()) { + addToHistory(text()); + emit sendText(text()); + resetLine(); + } } void InputLine::on_textChanged(QString newText) { @@ -195,7 +197,7 @@ void InputLine::on_textChanged(QString newText) { clear(); if(lines.count() >= 4) { - QString msg = tr("Do you really want to paste %1 lines?").arg(lines.count()); + QString msg = tr("Do you really want to paste %n lines?", "", lines.count()); msg += "

"; for(int i = 0; i < 3; i++) { msg += lines[i].left(40); @@ -214,9 +216,11 @@ void InputLine::on_textChanged(QString newText) { } foreach(QString line, lines) { - clear(); - insert(line); - emit returnPressed(); + if(!line.isEmpty()) { + clear(); + insert(line); + emit returnPressed(); + } } // if(newText.contains(lineSep)) { // clear();