diff options
| author | Karol Kosek <krkk@krkk.ct8.pl> | 2021-01-04 17:58:54 +0100 |
|---|---|---|
| committer | Felix Queißner <felix@ib-queissner.de> | 2021-01-05 09:30:52 +0100 |
| commit | 5c8f96e7509651b1c06d3eb961aa0500ee0b0a98 (patch) | |
| tree | 780ea8c517007a32c2a33449b041be8a47198f00 /src/browsertab.cpp | |
| parent | 576635322288c1c94af3b11a6f0e7b114dd446c2 (diff) | |
| download | kristall-5c8f96e7509651b1c06d3eb961aa0500ee0b0a98.tar.gz | |
BrowserTab: use simpler method for getting the HTML page title
Diffstat (limited to 'src/browsertab.cpp')
| -rw-r--r-- | src/browsertab.cpp | 20 |
1 files changed, 1 insertions, 19 deletions
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 <head> - QStringList head = page_html.split("</head>", QString::KeepEmptyParts, Qt::CaseInsensitive); - if (head[0] != page_html) - { - // Split at first title tag. - QStringList a = head[0].split("<title>", QString::KeepEmptyParts, Qt::CaseInsensitive); - if (a[0] != head[0]) - { - // Split at second tag. - QStringList b = a[1].split("</title>", 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")) { |
