From cb30cee7a065a074394347f112451decc4847674 Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Fri, 17 Jan 2020 20:25:44 +0200 Subject: Fix various gcc and clazy compile warnings --- lib/urlfilter/adblock/parser.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'lib/urlfilter/adblock/parser.cpp') diff --git a/lib/urlfilter/adblock/parser.cpp b/lib/urlfilter/adblock/parser.cpp index d65a2e4..68f895d 100644 --- a/lib/urlfilter/adblock/parser.cpp +++ b/lib/urlfilter/adblock/parser.cpp @@ -20,53 +20,53 @@ std::optional> parseComment(QString &line) std::optional> parseResourceOption(const QString &option) { - const bool exception = !option.startsWith(QLatin1Literal("~")); + const bool exception = !option.startsWith(QLatin1String("~")); - if(option.endsWith(QLatin1Literal("script"))) { + if(option.endsWith(QLatin1String("script"))) { // external scripts loaded via HTML script tag return std::make_pair(QWebEngineUrlRequestInfo::ResourceTypeScript, exception); - } else if(option.endsWith(QLatin1Literal("image"))) { + } else if(option.endsWith(QLatin1String("image"))) { // regular images, typically loaded via HTML img tag return std::make_pair(QWebEngineUrlRequestInfo::ResourceTypeImage, exception); - } else if(option.endsWith(QLatin1Literal("stylesheet"))) { + } else if(option.endsWith(QLatin1String("stylesheet"))) { // external CSS stylesheet files return std::make_pair(QWebEngineUrlRequestInfo::ResourceTypeStylesheet, exception); - } else if(option.endsWith(QLatin1Literal("object"))) { + } else if(option.endsWith(QLatin1String("object"))) { // content handled by browser plugins, e.g. Flash or Java return std::make_pair(QWebEngineUrlRequestInfo::ResourceTypeObject, exception); - } else if(option.endsWith(QLatin1Literal("xmlhttprequest"))) { + } else if(option.endsWith(QLatin1String("xmlhttprequest"))) { // requests started using the XMLHttpRequest object or fetch() API return std::make_pair(QWebEngineUrlRequestInfo::ResourceTypeXhr, exception); - } else if(option.endsWith(QLatin1Literal("object-subrequest"))) { + } else if(option.endsWith(QLatin1String("object-subrequest"))) { // requests started by plugins like Flash return std::make_pair(QWebEngineUrlRequestInfo::ResourceTypePluginResource, exception); - } else if(option.endsWith(QLatin1Literal("subdocument"))) { + } else if(option.endsWith(QLatin1String("subdocument"))) { // embedded pages, usually included via HTML frames return std::make_pair(QWebEngineUrlRequestInfo::ResourceTypeSubFrame, exception); - } else if(option.endsWith(QLatin1Literal("ping"))) { + } else if(option.endsWith(QLatin1String("ping"))) { // requests started by or navigator.sendBeacon() return std::make_pair(QWebEngineUrlRequestInfo::ResourceTypePing, exception); - } else if(option.endsWith(QLatin1Literal("websocket"))) { + } else if(option.endsWith(QLatin1String("websocket"))) { // requests initiated via WebSocket object qDebug("Resource type 'websocket' not available"); - } else if(option.endsWith(QLatin1Literal("webrtc"))) { + } else if(option.endsWith(QLatin1String("webrtc"))) { // connections opened via RTCPeerConnection instances to ICE servers qDebug("Resource type 'webrtc' not available"); - } else if(option.endsWith(QLatin1Literal("document"))) { + } else if(option.endsWith(QLatin1String("document"))) { // the page itself return std::make_pair(QWebEngineUrlRequestInfo::ResourceTypeMainFrame, exception); - } else if(option.endsWith(QLatin1Literal("other"))) { + } else if(option.endsWith(QLatin1String("other"))) { return std::make_pair(QWebEngineUrlRequestInfo::ResourceTypeUnknown, exception); } -- cgit v1.2.1