[Kde-pim] PIM/KDE Grantlee plugins
Daniel Vrátil
dvratil at kde.org
Sun Sep 20 22:48:10 BST 2015
Hola guys,
I've spend some time during past few days playing with IncidenceFormtter in
KCalUtils to use Grantlee templates instead of assembling the HTML in-place,
which I find ineffective and horrible to read/extend/maintain. Yes, I could
just add 10 lines of code to make it show comments in todos which I need for
Phabricator, but this was more fun :)
So far I have successfully created templates for todos, events, journals and
free/busy reports, the ITIP preview is still to be done, but there I probably
need to co-ordinate with Sandro who's working on the ObjecTreeParser
refactoring. I submitted the first part of the port as review for further
comments and discussion (https://git.reviewboard.kde.org/r/125331/). I think
it's better to do this in smaller steps, the ITIP formatter still works, so we
can port it at any later time (I also suspect it will be much more work).
Anyway, in order to use Grantlee effectively I had to write custom Grantlee
localizer that uses i18n() instead of tr(), and a plugin that provides custom
tag for inserting icons - e.g. {% icon dialog-ok small %} that generates <img
src="/usr/share/icons/.../dialog-ok.png" width="16" height="16" /> using
KIconTheme::iconPath().
Since the longterm plan is to use the template system in the new OTP as well
as in other places, this code should IMO be moved to some shared place -
something like pimutils, pimcommon, libkdepim, I don't know :) But it should
be outside kdepim.git so that we can use it from kcalutils and other places
too. Do you guys have an idea where we could put this? Or should we already
look into splitting some of the library that Laurent has been working on in
kdepim.git into it's own repository and put the code there (if that's the
plan).
Cheers,
Dan
PS: if anyone can move T749 to Done and T835 to In Progress in Phabricator,
please do so for me, Phabricator is refusing to talk to me the past couple
days (T841 if anyone's interested).
--
Daniel Vrátil
www.dvratil.cz | dvratil at kde.org
IRC: dvratil on Freenode (#kde, #kontact, #akonadi, #fedora-kde)
GPG Key: 0x4D69557AECB13683
Fingerprint: 0ABD FA55 A4E6 BEA9 9A83 EA97 4D69 557A ECB1 3683
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20150920/b60a708a/attachment.sig>
-------------- next part --------------
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/
More information about the kde-pim
mailing list