aboutsummaryrefslogtreecommitdiff
path: root/lib/web/webprofile.cpp
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2018-06-17 19:50:56 +0200
committerAqua-sama <aqua@iserlohn-fortress.net>2018-06-17 19:50:56 +0200
commitd340be4b27b9067c0057b20f6bd0228f03c994c6 (patch)
tree2cfe95ccf9d83cf14ecd0a154f6cd05d2b04745b /lib/web/webprofile.cpp
parentSort .profile by time (diff)
downloadsmolbote-d340be4b27b9067c0057b20f6bd0228f03c994c6.tar.xz
WebProfile: cache a list of cookies
ProfileView: delete selected items rather than current item Browser: store profiles in QMap instead of QHash
Diffstat (limited to 'lib/web/webprofile.cpp')
-rw-r--r--lib/web/webprofile.cpp14
1 files changed, 14 insertions, 0 deletions
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