X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Finputline.cpp;h=c7018e2d9b7c2593faf7afe87c3091a3760993b2;hp=d7b18f4716830fa0f926d5bec86fbfc9add1ab73;hb=38c619629af261ada7df30bbe71b19b0808867b3;hpb=0f94681b05463c64c75d25d18a0ab2fd1d4af7b9 diff --git a/src/uisupport/inputline.cpp b/src/uisupport/inputline.cpp index d7b18f47..c7018e2d 100644 --- a/src/uisupport/inputline.cpp +++ b/src/uisupport/inputline.cpp @@ -131,7 +131,14 @@ void InputLine::keyPressEvent(QKeyEvent * event) { //Since this is a ktextedit, we don't have this signal "natively" case Qt::Key_Return: event->accept(); - emit returnPressed(); + if(!text().isEmpty()) + emit returnPressed(); + break; + + case Qt::Key_Enter: + event->accept(); + if(!text().isEmpty()) + emit returnPressed(); break; #endif @@ -194,7 +201,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 %1 lines?", "", lines.count()).arg(lines.count()); msg += "

"; for(int i = 0; i < 3; i++) { msg += lines[i].left(40); @@ -213,9 +220,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();