Extending Grantlee based Messageviewheaders

Sandro Knauß sknauss at kde.org
Wed Dec 30 15:59:36 GMT 2020


Hey,

sorry took a while to answer.

> I want to extend a Grantlee messageviewerheader with attributes could be in
> a message.
> There is the rich/decorative header that supports Bugzilla status (by
> reading X-Bugzilla-*).
> Is it possible to extend grantlee based headers with similar statuses or
> reading arbitrary attributes from a message header?

If you only what to show the text content of additional headers you can have a 
look at [1]

kdepim-addons/examples/messageviewergrantleetheme/themes/example_fancy/

see header.desktop has the entry DisplayExtraVariables, there you can add the 
additinal headers you want to use:
DisplayExtraVariables=Sender,List-Id

in html you can use the same names with "-" removed (here Sender and ListId) 
see header.html.

If string representation of a header is not enough, than you first need to add 
c++ code [2]:

messageviewer/src/header/grantleeheaderformatter.cpp

Here you need to add new Formatter classes. 
After that you need to register the headerformatter (see line 293) than this 
header is formatted with your Formatter.

Btw. if you have some outcome please share.

sandro

[1] https://invent.kde.org/pim/kdepim-addons/-/tree/master/examples/
messageviewergrantleetheme/themes/example_fancy
[2] https://invent.kde.org/pim/messagelib/-/blob/master/messageviewer/src/
header/grantleeheaderformatter.cpp




More information about the kde-pim mailing list