D8087: Make HtmlWriter compatible with Grantlee::OutputStream

Volker Krause noreply at phabricator.kde.org
Sun Oct 1 15:08:50 BST 2017


vkrause created this revision.
vkrause added a reviewer: knauss.
Restricted Application added a project: KDE PIM.
Restricted Application added a subscriber: KDE PIM.

REVISION SUMMARY
  For that we need a QTextStream backed by a QIODevice. We have two
  implementation, one backed by a QBuffer and one by a QFile, rplacing
  most of the various sub-classes we had previously.
  
  This means that the internal buffer is now a QByteArray rather than a
  QString. That however turns out to not be a problem at all, as
  QWebEnginePage::setHtml() basically just calls setContent(html.toUtf8()),
  ie. we need a QByteArray in the end anyway.
  
  Another side-effect of the QIODevice usage is that this now becomes a lot
  more sensitive to being in the correct state, therefore also the test code
  needs to properly call begin/end now.
  
  In order to employ this to the full extend the next step is passing this
  along to all render methods and writing into it directly rather than using
  intermediate buffers, as well as adding a custom Grantlee item for nested
  templates so we can do this with streaming too.

REPOSITORY
  R94 PIM: Message Library

BRANCH
  top

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

AFFECTED FILES
  messagecomposer/autotests/cryptocomposertest.cpp
  messagecomposer/autotests/cryptofunctions.cpp
  messagecomposer/autotests/messagefactoryngtest.cpp
  messagecomposer/autotests/testhtmlwriter.h
  messageviewer/src/htmlwriter/webengineparthtmlwriter.cpp
  messageviewer/src/htmlwriter/webengineparthtmlwriter.h
  messageviewer/src/messagepartthemes/default/autotests/objecttreeparsertest.cpp
  messageviewer/src/messagepartthemes/default/autotests/quotehtmltest.cpp
  messageviewer/src/messagepartthemes/default/autotests/unencryptedmessagetest.cpp
  messageviewer/src/messagepartthemes/default/autotests/util.h
  messageviewer/src/messagepartthemes/default/defaultrenderer.cpp
  messageviewer/src/messagepartthemes/default/partrendered.cpp
  messageviewer/src/messagepartthemes/default/partrendered.h
  mimetreeparser/autotests/util.h
  mimetreeparser/src/CMakeLists.txt
  mimetreeparser/src/htmlwriter/bufferedhtmlwriter.cpp
  mimetreeparser/src/htmlwriter/bufferedhtmlwriter.h
  mimetreeparser/src/htmlwriter/filehtmlwriter.cpp
  mimetreeparser/src/htmlwriter/filehtmlwriter.h
  mimetreeparser/src/interfaces/htmlwriter.cpp
  mimetreeparser/src/interfaces/htmlwriter.h
  mimetreeparser/src/viewer/messagepart.cpp

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/20171001/f79c54fb/attachment.html>


More information about the kde-pim mailing list