From 549741018ef5a18d9ad7a51092438d764149b758 Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Fri, 31 Mar 2017 22:02:59 +0200 Subject: Added cookie widget --- src/webengine/webengineprofile.cpp | 11 +++++++++++ src/webengine/webengineprofile.h | 6 ++++++ 2 files changed, 17 insertions(+) (limited to 'src/webengine') diff --git a/src/webengine/webengineprofile.cpp b/src/webengine/webengineprofile.cpp index cd6291f..a72f3cf 100644 --- a/src/webengine/webengineprofile.cpp +++ b/src/webengine/webengineprofile.cpp @@ -27,6 +27,8 @@ WebEngineProfile::WebEngineProfile(QObject *parent) : QWebEngineProfile(parent) { // Off-the-record constructor + + m_cookiesForm = new CookiesWidget(cookieStore()); } WebEngineProfile::WebEngineProfile(const QString &storageName, QObject *parent) : @@ -35,6 +37,8 @@ WebEngineProfile::WebEngineProfile(const QString &storageName, QObject *parent) setPersistentStoragePath(sSettings->value("browser.profile.path").toString() + storageName); setCachePath(sSettings->value("browser.profile.path").toString() + storageName); + m_cookiesForm = new CookiesWidget(cookieStore()); + QString profilePath = persistentStoragePath() + "/profile.ini"; qDebug("Reading profile from [%s]", qUtf8Printable(profilePath)); QSettings config(profilePath, QSettings::IniFormat); @@ -106,6 +110,13 @@ WebEngineProfile::~WebEngineProfile() if(!isOffTheRecord()) { saveProfile(); } + + m_cookiesForm->deleteLater(); +} + +CookiesWidget *WebEngineProfile::cookieUI() +{ + return m_cookiesForm; } void WebEngineProfile::saveProfile() diff --git a/src/webengine/webengineprofile.h b/src/webengine/webengineprofile.h index 1845c99..c93ae52 100644 --- a/src/webengine/webengineprofile.h +++ b/src/webengine/webengineprofile.h @@ -22,6 +22,7 @@ #define WEBENGINEPROFILE_H #include +#include "forms/cookiesform.h" class WebEngineProfile : public QWebEngineProfile { @@ -32,10 +33,15 @@ public: ~WebEngineProfile(); + CookiesWidget *cookieUI(); + signals: public slots: void saveProfile(); + +private: + CookiesWidget *m_cookiesForm; }; #endif // WEBENGINEPROFILE_H -- cgit v1.2.1