D8102: Port internal render plugins to HtmlWriter

Sandro Knauß noreply at phabricator.kde.org
Mon Oct 2 15:11:20 BST 2017


knauss added inline comments.

INLINE COMMENTS

> defaultrenderer.cpp:868
> +
> +    const auto plugin = registry.at(0);
> +    return plugin->render(this, msgPart, htmlWriter);

we need a loop here to get all plugins. the registry.at(0) was just a shortcut to test my idea ( but its outofscope here). But here the streaming api has a big disadvantage, because you need to trust, that the plugin don't write anything to htmlWriter if it don't handle the MessagePart otherwise things get messed up in htmlWriter. Or can you somehow seek the output again, when a plugin don't handle the part aka return false?

> textmessagepartrenderer.cpp:44
>  
> -QSharedPointer<PartRendered> TextMessagePartRenderer::render(DefaultRendererPrivate *drp, const MimeTreeParser::MessagePartPtr &msgPart)
> -const
> +static QString alignText()
> +{

can be deleted.

> textmessagepartrenderer.cpp:75
> +    block.setProperty("showLink", mp->showLink());
> +    block.setProperty("dir", alignText());
> +

we have drp that has already the method drp->alignText()

REPOSITORY
  R94 PIM: Message Library

REVISION DETAIL
  https://phabricator.kde.org/D8102

To: vkrause, knauss
Cc: #kde_pim, dvasin, winterz, vkrause, mlaurent, knauss, dvratil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20171002/3641da46/attachment.html>


More information about the kde-pim mailing list