Use KPlugin for calendar applet plugins
ClosedPublic

Authored by dvratil on Dec 26 2016, 3:53 PM.

Details

Summary

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.

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.
dvratil updated this revision to Diff 9365.Dec 26 2016, 3:53 PM
dvratil retitled this revision from to Use KPlugin for calendar applet plugins.
dvratil updated this object.
dvratil edited the test plan for this revision. (Show Details)
dvratil added reviewers: aacid, mck182, mart.
dvratil set the repository for this revision to R242 Plasma Framework (Library).
dvratil added a subscriber: Plasma.
aacid edited edge metadata.Dec 27 2016, 9:05 PM

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.

mck182 resigned from this revision.Jan 3 2017, 3:55 AM
mck182 removed a reviewer: mck182.

Code looks good to me but I also don't have a setup to test this on anymore.

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"
+        ],
     }
 }
aacid added inline comments.Jan 10 2017, 11:32 PM
src/declarativeimports/calendar/eventpluginsmanager.cpp
171

This should be

const auto md = loader.metaData().value(QStringLiteral("MetaData")).toObject();

aacid added a comment.Jan 11 2017, 1:13 AM

+ "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

dvratil updated this revision to Diff 10022.Jan 11 2017, 9:07 AM
dvratil edited edge metadata.

Fix loading of legacy plugins.

Restricted Application added a project: Frameworks. · View Herald TranscriptJan 11 2017, 9:07 AM
Restricted Application added a subscriber: Frameworks. · View Herald Transcript
davidedmundson accepted this revision.Jan 11 2017, 5:54 PM
davidedmundson added a reviewer: davidedmundson.
This revision is now accepted and ready to land.Jan 11 2017, 5:54 PM
aacid accepted this revision.Jan 11 2017, 9:51 PM
aacid edited edge metadata.
This revision was automatically updated to reflect the committed changes.