khtml's find, KFind or KComboBox

Carsten Pfeiffer carpdjih at mailbox.tu-berlin.de
Wed Nov 20 18:26:38 GMT 2002


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

On Wednesday 20 November 2002 17:48, David Faure wrote:

> > Indeed the problem is that KHistoryCombo::addToHistory() removes the
> > item from where it is, and inserts it at position 0... Hmm, I guess
> > that's on purpose, to make it the "most current" again, so my first
> > attempt, fixing it there (which worked), is probably a bad idea.
>
> Actually, KHistoryCombo::addToHistory() could simply call setCurrentText()
> afterwards, _if_ the string that has just been added was the current text
> already. What do you think, Carsten?

I don't understand. addToHistory() inserts the new item at position 0 (and 
doesn't if the the same text is already there). Is that what you mean?

void KHistoryCombo::addToHistory( const QString& item )
{
    if ( item.isEmpty() || (count() > 0 && item == text(0) ))
        return;
[... ]

The text you add shall always be the first item in the combo.

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

iQEVAwUBPdvT4KWgYMJuwmZtAQEo8Af/a7Xil9sTG17qLKufXrFBGqMkyBvI4gok
nZI6c+lzPQg+bW48fRErZUiJXPPaJu1OgQJfIi86BsvyYgjJvdtLTuMLAgy/p/T6
rIGmgBvFDiS4YiJbDCiKUCnrSU/Htxk7+1YXpzCzxYmOmEjZ3XQ04ulMk6F2+6lx
CFU7+fzHvUSZqySxaPFKuvCEVTvOx4Te1htYyjzfojJ/IAdH1g9xIx1GkaQ6SaCx
/8KO1kZwq1A5AyOMLiSKosvwZcTowh9sdBYVi8dqEWmzYbYNdVKkq3li2LHuyB87
/UippcR2s0r6snWTVGVRVzZnUtwdvXLMS2ohrObgiNRo2b6Pz3Q5Kg==
=6ym8
-----END PGP SIGNATURE-----




More information about the kfm-devel mailing list