From 5c8f96e7509651b1c06d3eb961aa0500ee0b0a98 Mon Sep 17 00:00:00 2001 From: Karol Kosek Date: Mon, 4 Jan 2021 17:58:54 +0100 Subject: BrowserTab: use simpler method for getting the HTML page title --- src/browsertab.cpp | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) (limited to 'src/browsertab.cpp') diff --git a/src/browsertab.cpp b/src/browsertab.cpp index 820952a..3d52659 100644 --- a/src/browsertab.cpp +++ b/src/browsertab.cpp @@ -529,25 +529,7 @@ void BrowserTab::renderPage(const QByteArray &data, const MimeType &mime) document->setHtml(page_html); - // Find page title in HTML - // Split so we only look in the - QStringList head = page_html.split("", QString::KeepEmptyParts, Qt::CaseInsensitive); - if (head[0] != page_html) - { - // Split at first title tag. - QStringList a = head[0].split("", QString::KeepEmptyParts, Qt::CaseInsensitive); - if (a[0] != head[0]) - { - // Split at second tag. - QStringList b = a[1].split("", QString::KeepEmptyParts, Qt::CaseInsensitive); - if (b[0] != a[1]) - { - QTextDocument title; - title.setHtml(b[0]); - this->page_title = title.toPlainText(); - } - } - } + page_title = document->metaInformation(QTextDocument::DocumentTitle); } else if (not plaintext_only and mime.is("text","x-kristall-theme")) { -- cgit v1.2.3