fix returning of modified html from nonwebengine previewer which breaks feed detections - #935

This commit is contained in:
Martin Rotter 2023-05-02 15:08:43 +02:00
parent d0b69cbdcb
commit 8eea37ec3b
2 changed files with 5 additions and 2 deletions

View file

@ -281,7 +281,7 @@ void TextBrowserViewer::setUrl(const QUrl& url) {
}
QString TextBrowserViewer::html() const {
return QTextBrowser::toHtml();
return m_currentHtml;
}
QUrl TextBrowserViewer::url() const {
@ -511,11 +511,11 @@ void TextBrowserViewer::setHtml(const QString& html, const QUrl& base_url) {
setHtmlPrivate(html, base_url);
/*
QTextCursor cr(m_document.data());
cr.movePosition(QTextCursor::MoveOperation::Start);
/*
// this can be used instead of regexps, just browse document and collect resource addresses directly
while (!cr.atEnd()) {
if (!cr.movePosition(QTextCursor::MoveOperation::NextBlock)) {
@ -558,6 +558,7 @@ void TextBrowserViewer::setHtml(const QString& html, const QUrl& base_url) {
void TextBrowserViewer::setHtmlPrivate(const QString& html, const QUrl& base_url) {
m_currentUrl = base_url;
m_currentHtml = html;
QTextBrowser::setHtml(html);
setZoomFactor(m_zoomFactor);

View file

@ -114,6 +114,8 @@ class TextBrowserViewer : public QTextBrowser, public WebViewer {
private:
QUrl m_currentUrl;
QString m_currentHtml;
QPointer<RootItem> m_root;
QFont m_baseFont;
qreal m_zoomFactor = 1.0;