Skip to content
  • Volker Krause's avatar
    Make HtmlWriter compatible with Grantlee::OutputStream · 8d094a5e
    Volker Krause authored
    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.
    
    Reviewers: knauss
    
    Reviewed By: knauss
    
    Subscribers: mlaurent, #kde_pim
    
    Tags: #kde_pim
    
    Differential Revision: https://phabricator.kde.org/D8087
    8d094a5e