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

zhaixiang xiang.zhai at i-soft.com.cn
Fri Jul 8 01:04:54 UTC 2016


Hi David,

Thanks for your reply! Happy Euro Cup ;-)

It might needs to use static KServiceTypeTrader::weightedOffers(const
QString &serviceType) to get KServiceOfferList offers, for example,
https://github.com/isoft-linux/plasma-workspace/blob/Chinese-word-segmentation/runners/services/servicerunner.cpp#L93


KService::List services;
const KServiceOfferList offers =
KServiceTypeTrader::weightedOffers("Application");

KServiceOfferList::const_iterator itOff = offers.begin();
for (; itOff != offers.end(); ++itOff) {
     services.append((*itOff).service());
}


but kservice's weightedOffers is private access, so is it able to make
it public without B.A.D effect? https://github.com/isoft-linux/kservice/commit/58263791e8104bea1db3dbf83a0c27a98123bf5c

And thank Sune's Fwd ;-)

On 2016年07月07日 15:38, David Faure wrote:
> On mardi 28 juin 2016 20:39:40 CEST Sune Vuorela wrote:
>> On 2016-06-28, Leslie Zhai <xiang.zhai at i-soft.com.cn> wrote:
>>> Hi KDE developers,
>>>
>>> It might needs to use static KServiceTypeTrader::weightedOffers(const
>>> QString &serviceType) to get KServiceOfferList offers, for example,
>> I'll let David Faure (kservice maintainer) to comment on if this makes
>> sense or not. But if it does, then at least the KServiceOffer
>> documentation should also be made ready for public consumption.
> Somehow I didn't receive the initial request email (messup at mykolab.org...).
>
> Can you explain what is the use case for calling weightedOffers,
> as opposed to using the existing public API of KServiceTypeTrader ?
>

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






More information about the Kde-frameworks-devel mailing list