Re: KApplicationTrader API

2020-01-13 Thread David Edmundson
> > Note that the least-porting-effort solution is self() and trader language, > since the code currently uses KServiceTypeTrader for this. > > But I'm tempted to say lambdas are nicer (you can debug the filtering more > easily), and would allow to kill the whole > trader-language-parser from kse

Re: KApplicationTrader API

2020-01-12 Thread Albert Astals Cid
El diumenge, 12 de gener de 2020, a les 11:50:03 CET, David Faure va escriure: > I wrote a KApplicationTrader class in https://phabricator.kde.org/D25698 > and I need input on API. > > Use case: the user types "km" in krunner. > In order to find all applications that contain "km" (case insensitive

Re: KApplicationTrader API

2020-01-12 Thread Ivan Čukić
> auto filter = [](const KService::Ptr &service) { return > service->name().contains("km", Qt::CaseInsensitive); } auto offers = > KApplicationTrader::self()->query(filter); I'd vote for lambda/function object/callable (hello std::invoke in KF6?). If a more terse syntax is needed, it could be lat

KApplicationTrader API

2020-01-12 Thread David Faure
I wrote a KApplicationTrader class in https://phabricator.kde.org/D25698 and I need input on API. Use case: the user types "km" in krunner. In order to find all applications that contain "km" (case insensitive), do we want to write auto offers = KApplicationTrader::self()->query("'km' ~~ Name");