aboutsummaryrefslogtreecommitdiff
path: root/src/webengine
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2017-03-31 22:02:59 +0200
committerAqua-sama <aqua@iserlohn-fortress.net>2017-03-31 22:02:59 +0200
commit549741018ef5a18d9ad7a51092438d764149b758 (patch)
tree0fbe74b8569004c0a4ddb24d25cedaabeab36f82 /src/webengine
parentRewrote the pre-commit hook into Ruby (diff)
downloadsmolbote-549741018ef5a18d9ad7a51092438d764149b758.tar.xz
Added cookie widget
Diffstat (limited to 'src/webengine')
-rw-r--r--src/webengine/webengineprofile.cpp11
-rw-r--r--src/webengine/webengineprofile.h6
2 files changed, 17 insertions, 0 deletions
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 <QWebEngineProfile>
+#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