[Panel-devel] bookmark runner
Glenn Ergeerts
glenn.ergeerts at telenet.be
Fri Nov 2 10:36:01 CET 2007
On Thursday 01 November 2007 20:12:42 Aaron J. Seigo wrote:
> cool; other than the comments of the others here, i'd suggest putting sth
> like this at the start of match():
>
> if (search->term().length() < 3) {
> return;
> }
>
> this will prevent searching for 1 or 2 letters, which is likely to return
> lots of crud in this case. this is a somewhat common pattern for free text
> searching runns, btw. not sure if there should be some sort of generic
> support in AbstractRunner for this... probably not =)
>
> also, if you don't mind overly much ... if this goes into kdebase, and i
> think it probably should be there eventually, i'd personally appreciate it
> if the code adhered to the plasma coding style, so that this:
>
> + while(!currentBookmark.isNull())
> + {
> + if(currentBookmark.isGroup()) //recurse
> + matchingBookmarks +=
> searchBookmarks(currentBookmark.toGroup(), query);
> + else
> + {
> + if(currentBookmark.text().contains(query,
> Qt::CaseInsensitive)) +
> matchingBookmarks.append(currentBookmark);
> + }
> + currentBookmark = bookmarkGrp.next(currentBookmark);
> + }
>
> would become this:
>
> + while (!currentBookmark.isNull()) {
> + if (currentBookmark.isGroup()) { //recurse
> + matchingBookmarks +=
> searchBookmarks(currentBookmark.toGroup(), query);
> + } else {
> + if (currentBookmark.text().contains(query,
> Qt::CaseInsensitive)) {
> + matchingBookmarks.append(currentBookmark);
> + }
> + }
> + currentBookmark = bookmarkGrp.next(currentBookmark);
> + }
>
>
> i'm pretty relaxed when it comes to plugins, but it would be great to see
> some greater general consistency in workspace/plasma ...
>
> otherwise, i'm all for this addition ...
Hi,
attached is a new patch with the requested changes. I hope this complies with
the coding guidelines..
regards,
Glenn
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bookmarkrunner2.patch
Type: text/x-diff
Size: 6768 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/panel-devel/attachments/20071102/37315864/attachment.bin
More information about the Panel-devel
mailing list