Commit 97eb1de1 authored by Igor Kushnir's avatar Igor Kushnir
Browse files

Documentation: don't debug-print overly long data URLs

When QWebEnginePage::setHtml() is called, the URL's string
representation becomes "data:text/html;charset=UTF-8,PAGE", where PAGE
stands for the entire HTML contents. If kdevplatform.documentation.debug
is true, KDevelop prints a very long line each time a CMake or Man
documentation page is loaded. Such long lines are not particularly
useful but can slow the application down.

Print a general message in place of a URL with the "data" scheme.
parent 999d699b
Pipeline #204895 passed with stage
in 24 minutes and 51 seconds
......@@ -60,7 +60,13 @@ public:
bool acceptNavigationRequest(const QUrl &url, NavigationType type, bool isMainFrame) override
{
qCDebug(DOCUMENTATION) << "navigating to..." << url << type;
if (DOCUMENTATION().isDebugEnabled()) {
if (url.scheme() == QLatin1String("data")) {
qCDebug(DOCUMENTATION) << "navigating to a manually constructed page because" << type;
} else {
qCDebug(DOCUMENTATION) << "navigating to" << url << "because" << type;
}
}
if (type == NavigationTypeLinkClicked && m_isDelegating) {
emit m_view->linkClicked(url);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment