From c7ee37f552ea28647aaf7b8ffc3420835a97df45 Mon Sep 17 00:00:00 2001
From: Daniel Albers <daniel@lbers.com>
Date: Mon, 13 Oct 2008 11:58:51 +0200
Subject: [PATCH] clear InputLine on Key_Down

---
 src/uisupport/inputline.cpp |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/src/uisupport/inputline.cpp b/src/uisupport/inputline.cpp
index 3578145..ba0c873 100644
--- a/src/uisupport/inputline.cpp
+++ b/src/uisupport/inputline.cpp
@@ -53,13 +53,15 @@ void InputLine::keyPressEvent(QKeyEvent * event) {
 
     addToHistory(text(), true);
     
-    if(idx < history.count())
+    if(idx < history.count()) {
       idx++;
-
-    if(idx < history.count() || tempHistory.contains(idx)) // tempHistory might have an entry for idx == history.count() + 1
-      showHistoryEntry();
-    else
-      resetLine();              // equals clear() in this case
+      if(idx < history.count() || tempHistory.contains(idx)) // tempHistory might have an entry for idx == history.count() + 1
+        showHistoryEntry();
+      else
+        resetLine();              // equals clear() in this case
+    } else {
+      resetLine();		  // user pressed Key_Down on the most recent history line, so clear InputLine
+    }
 
     break;
     
@@ -129,6 +131,7 @@ void InputLine::on_textChanged(QString newText) {
 void InputLine::resetLine() {
   // every time the InputLine is cleared we also reset history index
   idx = history.count();
+  tempHistory.remove(idx);
   clear();
 }
 
-- 
1.5.4.3

