From 9b3fc5f404920244189264386093c6a6745e03af Mon Sep 17 00:00:00 2001 From: David Rosca Date: Sat, 31 Dec 2016 14:53:06 +0100 Subject: [PATCH] Update ignored schemes for saving history and icons --- src/lib/history/history.cpp | 14 +++++++++----- src/lib/navigation/locationbar.cpp | 2 +- src/lib/tools/iconprovider.cpp | 10 +++++----- 3 files changed, 15 insertions(+), 11 deletions(-) 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;