Use KPlugin to load Plasma calendar applet plugins so that the plugin metadata are translatable. We also keep backwards compatibility with the older (pre-KPlugin) plugins because Frameworks with this new code will be released before the next KDE Applications with adjusted metadata.
Details
Diff Detail
- Repository
- R242 Plasma Framework (Library)
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Looks good to me but i have *not* tried it since i don't really have a plasma&friends build environment setup, i'd prefer if someone else could do a quick check.
If noone can really test it, i guess i can try to find some time to build everything needed.
Ok, since people from Plasma land seem to be ignoring this i'll bite and try to review it myself, do you have the patch that would be needed by https://lxr.kde.org/source/kde/pim/kdepim-addons/plugins/plasma/pimeventsplugin/pimeventsplugin.json to use "the new method"?
diff --git a/plugins/plasma/pimeventsplugin/pimeventsplugin.json b/plugins/plasma/pimeventsplugin/pimeventsplugin.json index cae516e..ab419e0 100644 --- a/plugins/plasma/pimeventsplugin/pimeventsplugin.json +++ b/plugins/plasma/pimeventsplugin/pimeventsplugin.json @@ -1,10 +1,17 @@ { - "Name": "PIM Events Plugin", - "Description": "Calendar plugin for displaying events from KDE PIM calendars", - "Icon": "view-calendar", - "ConfigUi": "pimevents/PimEventsConfig.qml", - "Authors": { - "Name": "Daniel Vrátil", - "Email": "dvratil@kde.org" + "KPlugin": { + "Name": "PIM Events Plugin", + "Description": "Calendar plugin for displaying events from KDE PIM calendars", + "Icon": "view-calendar", + "ConfigUi": "pimevents/PimEventsConfig.qml", + "Authors": [ + { + "Name": "Daniel Vrátil", + "Email": "dvratil@kde.org" + } + ], + "ServiceTypes": [ + "PlasmaCalendar/Plugin" + ], } }
src/declarativeimports/calendar/eventpluginsmanager.cpp | ||
---|---|---|
171 | This should be const auto md = loader.metaData().value(QStringLiteral("MetaData")).toObject(); |
+ "ServiceTypes": [
+ "PlasmaCalendar/Plugin"
+ ],
This extra comma is evil and made me lose like 1 hour of my sleep, need to remove it or otherwise the .so doesn't contain the metadata