Is it able to make kservice's weightedOffers public access?

Leslie Zhai xiang.zhai at i-soft.com.cn
Mon Jul 11 02:20:07 UTC 2016


Hi David,

Thanks for your suggestion ;-) 
https://github.com/isoft-linux/plasma-workspace/commit/bef267249ee99b0ac4eafaa75116bfda5d2c1daf

On 2016年07月08日 19:14, David Faure wrote:
> On vendredi 8 juillet 2016 09:04:54 CEST zhaixiang wrote:
>> KService::List services;
>> const KServiceOfferList offers =
>> KServiceTypeTrader::weightedOffers("Application");
>>
>> KServiceOfferList::const_iterator itOff = offers.begin();
>> for (; itOff != offers.end(); ++itOff) {
>>       services.append((*itOff).service());
>> }
> You would get the same result by doing
> const KServiceList::List services = KServiceTypeTrader::self()->query("Applications");
>

-- 
Regards,
Leslie Zhai https://git.reviewboard.kde.org/users/lesliezhai/



More information about the Kde-frameworks-devel mailing list