move html creation to MessagePart.
ClosedPublic

Authored by knauss on Sep 22 2015, 4:59 PM.

Details

Reviewers
vkrause
Group Reviewers
KDE PIM
Maniphest Tasks
T719: Refactor objecttreeparser
Summary

split logic of creation of an MessageBlock and the rendering of
html into two steps.

This is actually the first real rewrite patch. I actally don't want
to change everything at once. That's why I make some intermediate steps.

The basic idea, where I whant to go:

run otp that returns a List<MessagePart> and than render it afterwards,
like it is now done for OTP::writeBodyStr.

I started now with the writeBodyStr function, that is actually responsible
for PGP inline, to have something to test against.

The idea in the end is, that MessagePart is independend of otp.
But I didn't want to move/copy functions around, because at the moment
the whole source is changing a lot. That's why I execute the functions inside otp.

Next steps are:
make all functions that are crypto related to use CryptpBlock and than move the
crypto related function out.

I made sure, that all tests still passes.

Diff Detail

Lint
No Linters Available
Unit
No Unit Test Coverage
knauss updated this revision to Diff 910.Sep 22 2015, 4:59 PM
knauss retitled this revision from to move html creation to MessagePart..
knauss updated this object.
knauss added a reviewer: vkrause.
knauss added a project: KDE PIM.
vkrause edited edge metadata.Sep 26 2015, 9:02 AM

Definitely a step in the right direction!

messageviewer/src/viewer/messagepart.cpp
45

Be aware that calling virtual methods from a ctor/dtor does not have the usual behavior, as the vtables for sub-classes are not yet/not anymore set up at this point.

Might not be a problem at the moment, but one should as least make sure that it wont become a problem eventually either, ie. the design should not rely on normal virtual behavior here.

messageviewer/src/viewer/objecttreeparser.cpp
2974

QVector :)

knauss updated this revision to Diff 946.Oct 8 2015, 10:27 AM
knauss edited edge metadata.

use QVector & and don't use virtual functions in ctor/dtor

knauss marked 2 inline comments as done.Oct 8 2015, 10:28 AM

issues fixed.

looks good to me

messageviewer/src/viewer/messagepart.h
41

These two seem effectively unused now?

knauss updated this revision to Diff 963.Oct 12 2015, 7:50 AM
knauss marked an inline comment as done.

removed enter/exit methods, because we don't use them at the moment

vkrause accepted this revision.Oct 12 2015, 4:17 PM
vkrause edited edge metadata.
This revision is now accepted and ready to land.Oct 12 2015, 4:17 PM
knauss closed this revision.Oct 12 2015, 5:21 PM