khtml's find, KFind or KComboBox

David Faure david at mandrakesoft.com
Wed Nov 20 23:44:19 GMT 2002


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wednesday 20 November 2002 23:41, Carsten Pfeiffer wrote:
> On Wednesday 20 November 2002 23:29, David Faure wrote:
> > > > But when the last (and also current) item is removed, then the
> > > > "current" index should be adjusted.
> >
> > That's precisely what doesn't happen.
> >
> > konqueror:  count=2 item=word1 currentItem()=1 text(0)=word2
> > konqueror: removeItem 1
> > konqueror: after removeItem: currentItem()=1 currentText()=
> 
> So the lineedit is empty? 
Yes.

> currentItem == 1 seems wrong as well (after removing, count() should be 1, so currentItem must be 0.

- From QComboBox::removeItem() :
    if ( index == d->current ) {    <<< that's the case
        if ( d->ed ) {
            QString s = QString::fromLatin1(""); <<< empty
            if (d->current < cnt - 1)          << NOT the case
                s = text( d->current );
            d->ed->setText( s );          <<< this clears the lineedit indeed

Ok, so you think this is a QComboBox bug? It should select the (newly) last item
when removing the (initially) last item?

The code for the no-lineedit case does 
                if (d->current > count()-1 && d->current > 0)
                    d->current--;
The same could happen in the with-lineedit case.... It would fix both
bugs at once (currentItem and currentText).
Should I report this to qt-bugs?
Do you agree on having a workaround in KHistoryCombo for Qt-3.1 though?

- -- 
David FAURE, david at mandrakesoft.com, faure at kde.org
http://people.mandrakesoft.com/~david/
Contributing to: http://www.konqueror.org/, http://www.koffice.org/
Get the latest KOffice - http://download.kde.org/stable/koffice-1.2/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE93B5U72KcVAmwbhARAgc/AJ9jl+/xazDD3p20RWSgQyYzuimJxgCfVnIL
/+ht/8ABZZf57cHtSKncjbw=
=F2QJ
-----END PGP SIGNATURE-----





More information about the kfm-devel mailing list