Extend MessagePart API as needed for porting the vcard plugin
ClosedPublic

Authored by vkrause on Oct 7 2017, 1:52 PM.

Diff Detail

Repository
R94 PIM: Message Library
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
vkrause created this revision.Oct 7 2017, 1:52 PM
Restricted Application added a project: KDE PIM. · View Herald TranscriptOct 7 2017, 1:52 PM
Restricted Application added a subscriber: KDE PIM. · View Herald Transcript
knauss added inline comments.Oct 9 2017, 9:17 AM
mimetreeparser/src/viewer/messagepart.cpp
105

add the classname of the messagepart to the mementoname/or replace it with this, with that we can also replace encryption and signature with this function.

150

no code duplication just run the old method till you delete the old method

vkrause added inline comments.Oct 9 2017, 7:24 PM
mimetreeparser/src/viewer/messagepart.cpp
105

I can't do that (yet), it would break code using the BodyPart based memento API, which uses the same key. Killing (or at least massively stripping down) BodyPart is on the TODO list though, which would enable this eventually.

150

And how would I get to the old code from here? BodyPart is a short-lived object only existing during processing.

knauss added inline comments.Oct 10 2017, 8:29 AM
mimetreeparser/src/viewer/messagepart.cpp
105

ah you mean you can't change it at the moment as long as the implementation is still part of bodyPart. But than the other way round? bodyPart calls the version in MessagePart?

150

ah sorry - I mixed up with partmetadata. But calling bodyPart -> messagepart would cleanup fix the code duplication.

vkrause added inline comments.Oct 10 2017, 7:01 PM
mimetreeparser/src/viewer/messagepart.cpp
105

How would that work? BodyPart is used to construct MessagePart inside process() usually.

150

Besides the technical difficulty of actually doing this (see above), I don't think this is really a problem here. With the patch series in, we wont be using BodyPart for rendering anymore, making stuff like makeLink() in BodyPart entirely unused and unusable. So we basically have to live with that 8 lines of duplicated code for just a couple of days until I get around to clean up BodyPart.

knauss accepted this revision.Oct 10 2017, 8:26 PM

not really happy with it, but if you clean this in some patches, than I'm happy...

mimetreeparser/src/viewer/messagepart.cpp
105

argh i though, that bodyPart has a link to the actuall messagepart, but I see that he only has link to the KMime::Content.

This revision is now accepted and ready to land.Oct 10 2017, 8:26 PM
This revision was automatically updated to reflect the committed changes.