[PATCH] KLineEdit websearch feature

Sebastian Tilsch Sebastian.Tilsch at inf.tu-dresden.de
Sun May 31 16:24:48 BST 2009


Am Freitag, 29. Mai 2009 16:59:03 schrieb Thomas Lübking:
> The mail entered my inbox /today/ and i couldn't find an entry in the kcd
> archive, so comments after a rough scan:
>
> 1. i guess implementing classes in a header is an absolute no-go :-(
>
I was wondering about this, too, but I looked in the kdelibs, where to put  
classes that are not part of the api but are needed for it.
The *_p.h classes are such files, and there are whole class implementations.
 I do not know why there is no *_p.cpp, but I suppose the reason is to keep it 
clean.
Where would you put those things?
> 2. addMenu() does not transfer onership, i.e. w/o actually seeing the patch
> applied i just assume your websearch popup doesn't get deleted anywhere,
> but probably created on each rmb -> leaks?!
>
> 3. QActions can query a QVariant data, so by binding the menu's
> truggered(QAction*) signal to your slot and (in case you need/want to get
> really sure) asking for sender() you can probably omit the SearchAction
>
The intention of the Patch was to look, whether some one is interested in 
adding such a feature. There would be a lot of more work to do, if  we want to 
have it everywhere, where you can select text. So I did not pay that much 
attention on details.
Maybe it is a good idea to add that feature to klipper, although, this would 
need some more clicks, and the advantage of a quicker websearch would get 
lost.
I agree, in aplications, like okular or the konsole this is a lot more 
usefull, than to put it in all klineedits.

I will wait with ideas like that, until the development of kde 4.4  begins.

> 4. though using blanks and brackets in klineedit.cpp seems to be not
> entirely consistent, there's certainly a blank between a keyword (if, for)
> and the opening bracket
>
> Thomas
>
> Am Saturday 23 May 2009 schrieb Sebastian Tilsch:
> > Hello,
> > this is my first attempt in developing for the KDE project ( except my
> > own programs). I added a small but useful feature, that I would like to
> > see in most of the components, where text is selectable.
> > It expands the context menu of a KLineEdit with the feature "search in
> > web...". It uses the current user configuration of Search Providers,
> > which is accessible with "kcmshell4 ebrowsing", but it will only use the
> > user chosen favorite ones.
> > It would be even more useful in other components, like the KRichTextEdit,
> > KRichTextWidget, selectable Labels (unfortunately all applications use
> > the native QLabel) and in programs, like konsole and konqueror.
> > I know from the KDE4.3 release Schedule that adding features for this
> > release is over, but maybe, if someone else has the opinion too, this
> > handy little feature could be useful, we could still integrate it. Than I
> > would also go on, adding it to the other components, as mentioned before.
> > I hope the position of the extra classes in "klineedit_p.h" is correct
> > (of course, only as long as it is not used by other control-elements).
> > The patch I attached modifies klineedit_p.h and klineedit.cpp






More information about the kde-core-devel mailing list