diff --git a/src/lib/history/history.cpp b/src/lib/history/history.cpp index 3a489d1a5..8ce388b05 100644 --- a/src/lib/history/history.cpp +++ b/src/lib/history/history.cpp @@ -68,11 +68,15 @@ void History::addHistoryEntry(const QUrl &url, QString title) if (!m_isSaving) { return; } - if (url.isEmpty() || - url.scheme() == QLatin1String("qupzilla") || - url.scheme() == QLatin1String("about") || - url.scheme() == QLatin1String("data") - ) { + + const QStringList ignoredSchemes = { + QStringLiteral("qupzilla"), + QStringLiteral("view-source"), + QStringLiteral("data"), + QStringLiteral("about") + }; + + if (url.isEmpty() || ignoredSchemes.contains(url.scheme())) { return; } diff --git a/src/lib/navigation/locationbar.cpp b/src/lib/navigation/locationbar.cpp index defa44292..e3715dd06 100644 --- a/src/lib/navigation/locationbar.cpp +++ b/src/lib/navigation/locationbar.cpp @@ -235,7 +235,7 @@ QString LocationBar::convertUrlToText(const QUrl &url) QString stringUrl = QzTools::urlEncodeQueryString(url); - if (stringUrl == QL1S("qupzilla:speeddial") || stringUrl.startsWith(QL1S("qupzilla:adblock")) || stringUrl == QL1S("about:blank")) { + if (stringUrl == QL1S("qupzilla:speeddial") || stringUrl == QL1S("about:blank")) { stringUrl.clear(); } diff --git a/src/lib/tools/iconprovider.cpp b/src/lib/tools/iconprovider.cpp index ac8d8e872..27b5c865a 100644 --- a/src/lib/tools/iconprovider.cpp +++ b/src/lib/tools/iconprovider.cpp @@ -58,13 +58,13 @@ void IconProvider::saveIcon(WebView* view) QStringLiteral("qupzilla"), QStringLiteral("ftp"), QStringLiteral("file"), - QStringLiteral("view-source") + QStringLiteral("view-source"), + QStringLiteral("data"), + QStringLiteral("about") }; - for (const QString &scheme : ignoredSchemes) { - if (view->url().scheme() == scheme) { - return; - } + if (ignoredSchemes.contains(view->url().scheme())) { + return; } BufferedIcon item;