[Bug 224442] New: KHistoryComboBox-addToHistory changes currentText (in some cases)

Peter Muehlenpfordt bugsearch at fantasymail.de
Wed Jan 27 09:19:39 GMT 2010


https://bugs.kde.org/show_bug.cgi?id=224442

           Summary: KHistoryComboBox-addToHistory changes currentText (in
                    some cases)
           Product: kde
           Version: unspecified
          Platform: Ubuntu Packages
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: general
        AssignedTo: unassigned-bugs at kde.org
        ReportedBy: bugsearch at fantasymail.de


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

-- 
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the Unassigned-bugs mailing list