Status | Assigned | Task | ||
---|---|---|---|---|
Open | None | T12171 Meta task: KService | ||
Open | alex | T12181 KService: deprecate KServiceType |
Deprecating this seems like a mess, because it is used quite often internally.
How about emitting a deprecation warning for the external users and making it a implementation Detail in KF6? Then we could clean it up at any time during the KF6 lifetime (if we don't need it anymore).
Looking at the usages I only see one in a KIO test, though it seems not that useful IMHO.
@dfaure But there are still usages in ApplicationTrader (the usage in KService should be deprecated as well, since it will not be useful in KF6)
(this was the part where I got stuck when using the deprecation macros, but I somehow was unable to find it when we talked in the meeting ๐ )
KService::List KApplicationTrader::query(FilterFunc filterFunc) { // Get all applications KSycoca::self()->ensureCacheValid(); KServiceType::Ptr servTypePtr = KSycocaPrivate::self()->serviceTypeFactory()->findServiceTypeByName(QStringLiteral("Application")); Q_ASSERT(servTypePtr); if (servTypePtr->serviceOffersOffset() == -1) { return KService::List(); } KService::List lst = KSycocaPrivate::self()->serviceFactory()->serviceOffers(servTypePtr); applyFilter(lst, filterFunc, true); // true = filter out service with NotShowIn=KDE or equivalent qCDebug(SERVICES) << "query returning" << lst.count() << "offers"; return lst; }
Yeah that's because ksycoca still contains all sorts of service types: "Application" but also all others. So when querying that DB, we still need to filter on "Application". Once we get rid of non-application desktop files in ksycoca, we can also get rid of that filtering.
I guess that means deprecating KServiceType has to wait indeed.
Would the deprecation message I had originally in the KServiceTypeTrader deprecation MR (https://invent.kde.org/frameworks/kservice/-/merge_requests/71/diffs?diff_id=220762&start_sha=4c1e4fbb57df8273c19abb842aba528fe28f204f#f720654fa73490c7f3a67a876cb9a5bac40e0c35_33_32) be enough to inform users about this change?
Then we can clean it up when KF6 is branched.
Done with commit https://invent.kde.org/frameworks/kservice/commit/d9a958b7925b5442aa39dcab280146243fe134b2
I look forward to cleaning it up on KF6 branching :)
WIP branch, not finished yet: https://invent.kde.org/frameworks/kservice/-/commits/work/nico/servicetype/