khtml's find, KFind or KComboBox

Carsten Pfeiffer carpdjih at mailbox.tu-berlin.de
Wed Nov 20 21:54:04 GMT 2002


-----BEGIN PGP SIGNED MESSAGE-----

On Wednesday 20 November 2002 22:14, David Faure wrote:

> > The text you add shall always be the first item in the combo.
>
> But not necessarily the currentText().
> The problem here is that in KFindDialog, the addToHistory() call
> _changes_ the current text, so when the caller calls currentText(),
> it gets an empty string.
>
> Precise description in the initial report. I just debugged a bit more, and
> what happens, if you type A, then B, is that
> the combo has item0=B and item1=A.
> So pressing up (or down) to select A again causes addToHistory("A"), where
> text(0)=="B", so the above if() doesn't apply. Then removeItem(1) is
> called, which clears the current text. Then insertItem(0) will put "A" at
> position 0 again - but the bug is that currentText() is now empty.

The removing only happens when a duplicate of the to be added item is present 
or when the "maxCount" is reached. In that case, the last item is going to be 
removed. But when the last (and also current) item is removed, then the 
"current" index should be adjusted. QComboBox always has a current item, no? 
(when not empty at least) Then currentText() should return the text of the 
new current item, probably again the new last item.

Cheers
Carsten Pfeiffer
-----BEGIN PGP SIGNATURE-----

iQEVAwUBPdwEfKWgYMJuwmZtAQF3oAgAm6my7zCwJpKV9YaKIkDUdI6QRIlXdqsK
6GnkEhprz1W17y5Y8QKWqx4BYM5Q5sL0zvauVaSRBDhVHJ1ef+xKIY+SKotaMlCI
PUebaStgZa1pzpPHcMNxctOIsPgCMM32/Ui2HLqyUpa4EY/ayA0BoUBhL/UamLzC
IJ9povz5WdqiRDhiBL6PFCexciPkAqv5I40m9A9sNLL1f/HqcHkYvCVpa+Q2VHWd
Txc0YAv9WWlxwkmzUknBzcHQPOSHRkcbl7B9809Oo7aExD4OEfWGIj1zJsbscP3z
uAWAKgz96RYbCK9dJKyGbhb+uM96HTwmEZs7/4OUbQg8g/2543mRdw==
=laDY
-----END PGP SIGNATURE-----




More information about the kfm-devel mailing list