From d340be4b27b9067c0057b20f6bd0228f03c994c6 Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Sun, 17 Jun 2018 19:50:56 +0200 Subject: WebProfile: cache a list of cookies ProfileView: delete selected items rather than current item Browser: store profiles in QMap instead of QHash --- lib/web/webprofile.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'lib/web/webprofile.cpp') diff --git a/lib/web/webprofile.cpp b/lib/web/webprofile.cpp index 37338b9..1124261 100644 --- a/lib/web/webprofile.cpp +++ b/lib/web/webprofile.cpp @@ -79,6 +79,13 @@ WebProfile::WebProfile(const QString &name, const QString &configPath, QObject * #ifdef QT_DEBUG qDebug("Creating otr profile %s", qUtf8Printable(m_name)); #endif + + connect(this->cookieStore(), &QWebEngineCookieStore::cookieAdded, this, [this](const QNetworkCookie &cookie) { + m_cookies.append(cookie); + }); + connect(this->cookieStore(), &QWebEngineCookieStore::cookieRemoved, this, [this](const QNetworkCookie &cookie) { + m_cookies.removeAll(cookie); + }); } WebProfile::WebProfile(const QString &storageName, const QString &name, const QString &configPath, QObject *parent) @@ -90,6 +97,13 @@ WebProfile::WebProfile(const QString &storageName, const QString &name, const QS #ifdef QT_DEBUG qDebug("Creating profile %s", qUtf8Printable(m_name)); #endif + + connect(this->cookieStore(), &QWebEngineCookieStore::cookieAdded, this, [this](const QNetworkCookie &cookie) { + m_cookies.append(cookie); + }); + connect(this->cookieStore(), &QWebEngineCookieStore::cookieRemoved, this, [this](const QNetworkCookie &cookie) { + m_cookies.removeAll(cookie); + }); } QString WebProfile::search() const -- cgit v1.2.1