fix returning of modified html from nonwebengine previewer which breaks feed detections - #935
This commit is contained in:
parent
d0b69cbdcb
commit
8eea37ec3b
2 changed files with 5 additions and 2 deletions
|
|
@ -281,7 +281,7 @@ void TextBrowserViewer::setUrl(const QUrl& url) {
|
||||||
}
|
}
|
||||||
|
|
||||||
QString TextBrowserViewer::html() const {
|
QString TextBrowserViewer::html() const {
|
||||||
return QTextBrowser::toHtml();
|
return m_currentHtml;
|
||||||
}
|
}
|
||||||
|
|
||||||
QUrl TextBrowserViewer::url() const {
|
QUrl TextBrowserViewer::url() const {
|
||||||
|
|
@ -511,11 +511,11 @@ void TextBrowserViewer::setHtml(const QString& html, const QUrl& base_url) {
|
||||||
|
|
||||||
setHtmlPrivate(html, base_url);
|
setHtmlPrivate(html, base_url);
|
||||||
|
|
||||||
|
/*
|
||||||
QTextCursor cr(m_document.data());
|
QTextCursor cr(m_document.data());
|
||||||
|
|
||||||
cr.movePosition(QTextCursor::MoveOperation::Start);
|
cr.movePosition(QTextCursor::MoveOperation::Start);
|
||||||
|
|
||||||
/*
|
|
||||||
// this can be used instead of regexps, just browse document and collect resource addresses directly
|
// this can be used instead of regexps, just browse document and collect resource addresses directly
|
||||||
while (!cr.atEnd()) {
|
while (!cr.atEnd()) {
|
||||||
if (!cr.movePosition(QTextCursor::MoveOperation::NextBlock)) {
|
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) {
|
void TextBrowserViewer::setHtmlPrivate(const QString& html, const QUrl& base_url) {
|
||||||
m_currentUrl = base_url;
|
m_currentUrl = base_url;
|
||||||
|
m_currentHtml = html;
|
||||||
|
|
||||||
QTextBrowser::setHtml(html);
|
QTextBrowser::setHtml(html);
|
||||||
setZoomFactor(m_zoomFactor);
|
setZoomFactor(m_zoomFactor);
|
||||||
|
|
|
||||||
|
|
@ -114,6 +114,8 @@ class TextBrowserViewer : public QTextBrowser, public WebViewer {
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QUrl m_currentUrl;
|
QUrl m_currentUrl;
|
||||||
|
QString m_currentHtml;
|
||||||
|
|
||||||
QPointer<RootItem> m_root;
|
QPointer<RootItem> m_root;
|
||||||
QFont m_baseFont;
|
QFont m_baseFont;
|
||||||
qreal m_zoomFactor = 1.0;
|
qreal m_zoomFactor = 1.0;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue