Proof of concept: KHTMLFindBar for KHTMLPart

Bernhard Beschow bbeschow at cs.tu-berlin.de
Mon Sep 1 17:08:33 BST 2008


Hi list,

I've been wondering if it was possible to implement a non-intrusive find behaviour a la find-as-you-type for the KHTMLPart using a find bar. While there already exists the "find ahead" feature, which is indeed very non-intrusive, this seems to be something for more advanced users. I guess users usually discover the find dialog for their search activities, which is a bit uncomfortable to work with and tends to get in the way. This find bar implementation tries to bridge this gap. See the attached patch for a proof of concept.

Regarding the implementation, I probably implemented it in a rather uncommon way. Why? Because the KHTMLPart consists of more than 7k (!) LOC... This was way too much to fit into my limited mind. So I figured the best way for me was to factor out the find functionality into something like a plugin and make the modifications there. In the KPart, I turned all public methods into forwarders to the "plugin" and kept all virtual methods in order not to run into BIC issues.

The find bar is made visible in a framework similar to what the kate part has (I actually copied lots of code from there). At this point I realized that this framework could also be used to implement a non-intrusive kwallet bar a la Firefox. That's why there is a bottomViewBar() and a topViewBar() in the KHTMLPart.

So please tell me what you think. It'd be very cool if this patch would make it into trunk, though this might requiere a couple of steps.

Best whishes,
Bernhard
-------------- next part --------------
A non-text attachment was scrubbed...
Name: findbar.diff.zip
Type: application/x-zip
Size: 15758 bytes
Desc: not available
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20080901/ff444f70/attachment.bin>


More information about the kfm-devel mailing list