khtml's find, KFind or KComboBox

David Faure david at mandrakesoft.com
Tue Nov 19 22:18:20 GMT 2002


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

On Tuesday 19 November 2002 21:05, Koos Vriezen wrote:
> Hi,
> 
> Wondering why,
>  open a html page, choose a word there and enter it in the ^F box and
>  press enter and ESC next - choose another word and do the same - press ^F
>  and move the cursor up to the previous word and press enter,
> it shows 'Find next occurrence of "?', I found that the pattern of KFind
> changes to something strange (and eventually causes a crash):
> 
> #0  KFindDialog::textSearchChanged(QString const&) (this=....
> ...
> #4  0x40dc139b in QComboBox::textChanged(QString const&) ()
> ...
> #12 0x40b93960 in QComboBox::removeItem(int) ()
> #13 0x405fbd5c in KHistoryCombo::addToHistory(QString const&) ()
> #14 0x417882ca in KFindDialog::slotOk()
>
> Maybe KFind or KComboBox should disconnect a signal before changing
> history?

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.

Better patch attached, fixes it in KFindDialog, storing the string (it turns out we
already have a member var for the pattern, for other reasons).

This relies on pattern() not being called before Ok is being clicked.
But since this dialog is usually modal, it shouldn't be a problem.
Please review the attached patch.

> d->m_find is not always deleted when a new KFind is created.
Ooops. Fixed, thanks.

- -- 
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)

iD8DBQE92ris72KcVAmwbhARAhXfAJ4pRisHY6LUMXza95anYG7DwcUnQwCfSE0W
gz5zqSSJT43o3cO/puX9s+E=
=O4cR
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kfinddialog.diff
Type: text/x-diff
Size: 3009 bytes
Desc: not available
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20021119/6fc4059c/attachment.diff>


More information about the kfm-devel mailing list