Install okularpart into plugins/kf5/parts/, embed JSON metadata
Needs RevisionPublic

Authored by dfaure on Dec 22 2019, 9:22 PM.

Details

Summary

This will make it possible to load parts using KPluginLoader.

Test Plan

Both okular and konqueror can still display PDFs

Diff Detail

Repository
R223 Okular
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 20507
Build 20525: arc lint + arc unit
dfaure created this revision.Dec 22 2019, 9:22 PM
Restricted Application added a project: Okular. · View Herald TranscriptDec 22 2019, 9:22 PM
Restricted Application added a subscriber: okular-devel. · View Herald Transcript
dfaure requested review of this revision.Dec 22 2019, 9:22 PM
dfaure updated this revision to Diff 72020.Dec 22 2019, 9:57 PM
dfaure retitled this revision from Install okularpart into plugins/parts/ to Install okularpart into plugins/kparts/.

Actually, let's make it plugins/kparts for proper namespacing.

dfaure updated this revision to Diff 72021.Dec 22 2019, 10:03 PM
dfaure retitled this revision from Install okularpart into plugins/kparts/ to Install okularpart into plugins/kf5/parts/.

In fact, webenginepart and others had a better idea already: plugins/kf5/parts.

This way we can co-install kf5 and kf6 based parts, and especially avoid crashes
when a kf6 app tries to load a kf5 part or vice-versa.

Sorry for the noise.

At least Kile tries to load the Okular KPart via the binary name and using the constructor of KPluginLoader which only searches in the normal Qt plugin paths, not subdirs, Possibly there are others who copied that code. No idea what to do, besides promoting the use of metadata-based plugin searching...

kossebau added a comment.EditedDec 22 2019, 10:42 PM

Oh, and the Calligra plugins for Okular (edit: when used with the KPart) will also break, as they (edit: desktop files they deploy for that use-case) also have X-KDE-Library=okularpart, given then they also work by being subplugins to the Okular KPart binary, so need to reference it,

dfaure planned changes to this revision.Dec 23 2019, 7:58 AM

Thanks for the research and additional information. Indeed in the light of this, this patch has to wait until the KF6 branching. Putting it on hold for now.

dfaure updated this revision to Diff 72574.Jan 1 2020, 7:55 PM
dfaure retitled this revision from Install okularpart into plugins/kf5/parts/ to Install okularpart into plugins/kf5/parts/, embed JSON metadata.
dfaure removed a subscriber: kossebau.

Embed JSON metadata

aacid added a comment.Jan 7 2020, 10:37 PM

Does this break generators that are not inside the okular codebase?

If they have X-KDE-Library=kf5/parts/okularpart then yes, likely.

This can wait until KF6.

aacid added a comment.Jan 8 2020, 9:38 PM

i'd say shelf it for KF6 then, thanks :)

aacid requested changes to this revision.Feb 21 2020, 6:53 PM

Please move as a Merge Request in https://invent.kde.org/kde/okular

We have pre-commit CI and lots of checks including clazy and clang-tidy there so it's a much better place for doing the review/approval/merge of the code.

This revision now requires changes to proceed.Feb 21 2020, 6:53 PM