Version: (using KDE 4.3.2) Compiler: gcc 4.4.1 OS: Linux Installed from: Ubuntu Packages I spotted this bug in Krusader commandline history. If you enter a command (manually) that's already in the history and above the selected history entry the selected command is executed instead of the entered. I looked to the source and tracked the problem down to the addToHistory method from KHistoryComboBox class. While cleaning the duplicates, the currentText changes to the text of the currentItem as far as the old entry is removed (khistorycombobox.cpp, line 198). I give an example... We have three items in history: [0] c, [1] b, [2] a The currentIndex is now 2 (a), the currentText 'a' Enter 'b' in the editline and we get the following history: [0] b, [1] c, [2] a The currentIndex is still 2 (a), but the currentText is 'a' and not 'b' as we entered. This problem occurs, if any item from index 1..(currentIndex-1) is entered manually. It seems to come from the QComboBox below, but I can't figure out what happens here... A simple bugfix could be to store and reset the text with setEditText() after deleting the duplicates. Peter
Created attachment 40283 [details] Simple cmake project to demonstrate the bug compile and run the program (cmake .; make) Three history items are added by default (a, b, c). Enter e.g. 'd', the currentText will be 'd'. Enter 'b' after that and the currentText / editline will change to 'a'.
Which Qt version do you use? I cannot reproduce with Qt 4.6, or I did not understand the steps in comment #1. When you say "Enter", do you mean clicking the "Add" button, just typing the letter, or additionally pressing the Enter key?
I'm currently using Qt 4.5.2 (running Kubuntu 9.10 with KDE 4.3.2). After starting the test-program: - click in editline and hit backspace-key to clear - hit 'd'-key (without enter-key) - click [Add] - click in editline and hit backspace-key to clear - hit 'b'-key (without enter-key) - click [Add] I'll try it with Qt 4.6 on Kubuntu 10.04 (alpha) the next days.
Created attachment 41225 [details] Modified version of the demo program Tried it now on KDE 4.4.0 with Qt 4.6.1 - it works here with my first demo program as it should be - something has changed in Qt/KDE. But the problem is still there in Krusader: it seems, the connection from returnPressed(const QString &) causes the bug (connecting returnPressed() without argument works). I changed my demo program to show the bug with KDE 4.4/Qt 4.6, too. There is no 'Add' button anymore. Make sure, item 'a' is selected in the drop down list, delete 'a' and enter 'b', press 'Return' and it will change to 'a'.
This bug still exists in Kubuntu 10.10 with KDE 4.5.1 and Qt 4.7.0.
This bug still exists in Kubuntu 11.04 with KDE 4.6.2 and Qt 4.7.2.
This bug still exists in Kubuntu 11.10 with KDE 4.7.2 and Qt 4.7.2.
Can not be reproduced with current KDE/Qt versions.