From 4cbf8607e94732cf4318451d397e0d416c0080b7 Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Tue, 26 Dec 2017 16:29:21 +0100 Subject: UrlRequestInterceptor fixes - Using QHash to store HostRule's, so lookup should be faster - HostRule is now a struct --- src/webengine/urlinterceptor.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/webengine/urlinterceptor.h') diff --git a/src/webengine/urlinterceptor.h b/src/webengine/urlinterceptor.h index 95e96e2..af0bf35 100644 --- a/src/webengine/urlinterceptor.h +++ b/src/webengine/urlinterceptor.h @@ -10,13 +10,16 @@ #define URLREQUESTINTERCEPTOR_H #include -#include -#include "hostrule.h" class UrlRequestInterceptor : public QWebEngineUrlRequestInterceptor { Q_OBJECT public: + + struct HostRule { + bool isBlocking; + }; + explicit UrlRequestInterceptor(const QString &path, QObject *parent = nullptr); ~UrlRequestInterceptor(); @@ -26,7 +29,7 @@ public slots: int parseHostfile(const QString &filename); private: - std::vector m_rules; + QHash m_rules; }; #endif // URLREQUESTINTERCEPTOR_H -- cgit v1.2.1