Fixing BR #167 (Key down now puts the content of inputline into the history (doing...
authorMarcus Eggenberger <egs@quassel-irc.org>
Sun, 22 Jun 2008 14:31:32 +0000 (16:31 +0200)
committerMarcus Eggenberger <egs@quassel-irc.org>
Mon, 23 Jun 2008 11:12:11 +0000 (13:12 +0200)
src/uisupport/inputline.cpp

index 31ec399..6ea156a 100644 (file)
@@ -41,7 +41,11 @@ void InputLine::keyPressEvent(QKeyEvent * event) {
   } else if(event->key() == Qt::Key_Down) {
     if(idx < history.count()) idx++;
     if(idx < history.count()) setText(history[idx]);
-    else setText("");
+    else if(!text().isEmpty()) {
+      history << text();
+      idx = history.count();
+      setText("");
+    }
     event->accept();
   } else if(event->key() == Qt::Key_Select) {  // for Qtopia
     emit returnPressed();