Fix wrong "Unable to find service type" warnings
ClosedPublic

Authored by dfaure on Apr 22 2019, 8:32 PM.

Details

Summary

If we parsed the service type from a qrc file (like kpackagetool does)
then it's wrong to later on say we can't find the file defining that
service type.

Test Plan

make uninstall in kpackage, then
XDG_DATA_DIRS=$KDEDIR/share <builddir>/bin/kpackagetool5 --appstream-metainfo . --appstream-metainfo-output /tmp/a.xml

Used to say: Unable to find service type for service "KPackage/Generic" listed in "./metadata.desktop"
even though it parsed ":/kservicetypes5/kpackage-generic.desktop" before.

For this we need to extract and store the name of the service type we're
parsing (key "X-KDE-ServiceType").

Diff Detail

Repository
R244 KCoreAddons
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 11172
Build 11190: arc lint + arc unit
dfaure created this revision.Apr 22 2019, 8:32 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptApr 22 2019, 8:32 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
dfaure requested review of this revision.Apr 22 2019, 8:32 PM
aacid added a subscriber: aacid.Apr 22 2019, 10:11 PM

Is this autotestable?

dfaure updated this revision to Diff 56867.Wed, Apr 24, 7:35 AM

Improve unittest - which no longer prints a warning about example/servicetype

It looks good to me, but i'm not sure i know enough about this code to give you an approved, but if noone else does, let's assume i did :D

dfaure added a reviewer: apol.Fri, Apr 26, 2:49 PM
apol accepted this revision.Fri, Apr 26, 11:28 PM

Thanks!

This revision is now accepted and ready to land.Fri, Apr 26, 11:28 PM
anthonyfieroni added inline comments.
src/lib/plugin/desktopfileparser.cpp
402

Where def is deleted?

dfaure added inline comments.Sat, Apr 27, 1:09 PM
src/lib/plugin/desktopfileparser.cpp
402

It's owned by the QCache.

dfaure closed this revision.Sat, Apr 27, 1:10 PM