KIO: port the URI filter plugins from KServiceTypeTrader to json+KPluginMetaData
ClosedPublic

Authored by dfaure on Aug 25 2017, 9:09 AM.

Details

Summary

This makes it possible to run the unittest without installing the
plugins first.

One thing I don't understand is the need for toString().toInt(),
or in other words, why my json file with a numeric value gets turned
into a string value when using qtplugininfo to inspect the plugin:
User Data: {

"X-KDE-InitialPreference": "5"

}

Test Plan

make uninstall; bin/jobtest

Diff Detail

Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
dfaure created this revision.Aug 25 2017, 9:09 AM
bshah added a subscriber: bshah.Aug 25 2017, 9:25 AM

One thing I don't understand is the need for toString().toInt(),
or in other words, why my json file with a numeric value gets turned
into a string value when using qtplugininfo to inspect the plugin:

Maybe you need to add following in the src/widgets/kurifilterplugin.desktop

[PropertyDef::X-KDE-InitialPreference]
Type=int
elvisangelaccio added inline comments.
src/widgets/kurifilter.cpp
676–677

This comment looks outdated now, should probably be removed?

This comment was removed by vandenoever.
In D7533#139802, @bshah wrote:

One thing I don't understand is the need for toString().toInt(),
or in other words, why my json file with a numeric value gets turned
into a string value when using qtplugininfo to inspect the plugin:

Maybe you need to add following in the src/widgets/kurifilterplugin.desktop

[PropertyDef::X-KDE-InitialPreference]
Type=int

Ah, indeed. That, and passing the servicetype file to kcoreaddons_add_plugin. Thanks!

dfaure updated this revision to Diff 18829.Aug 26 2017, 9:30 PM

Provide servicetype file to the cmake macro so that the priority is stored as an int.

bshah accepted this revision.Aug 27 2017, 10:30 AM

Looks good to me.

(Maybe modify the commit message to remove the priority int/string bits)

This revision is now accepted and ready to land.Aug 27 2017, 10:30 AM

Ah, phabricator is strange, I have indeed modified the commit log before doing arc diff but it didn't update it here.

dfaure closed this revision.Aug 27 2017, 6:59 PM
bshah added a comment.EditedAug 28 2017, 4:59 AM

Ah, phabricator is strange, I have indeed modified the commit log before doing arc diff but it didn't update it here.

And it also did overwrite your change in actual commit message it seems *shrug*