From e81526f15e8c1e9c82b27009dbe512f78cf1dc0f Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Sun, 24 Jun 2018 17:27:44 +0200 Subject: Add Session class --- lib/web/webprofile.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'lib/web/webprofile.h') diff --git a/lib/web/webprofile.h b/lib/web/webprofile.h index 279e6bf..d41625c 100644 --- a/lib/web/webprofile.h +++ b/lib/web/webprofile.h @@ -15,6 +15,7 @@ #include #include #include +#include class WebProfile : public QWebEngineProfile { @@ -53,6 +54,13 @@ public: return WebProfile::profile; } + static WebProfile* loadProfile(const QString &name, const QHash &defaults, const QString &path = QString(), QObject *parent = nullptr); + + const QString id() const + { + return profiles.key(const_cast(this), ""); + } + QString name() const { return m_name; @@ -104,7 +112,9 @@ signals: private: static WebProfile *profile; + static QMap profiles; + QString m_id; QString m_configPath; QString m_name; QString m_search = QString("about:blank"); @@ -114,7 +124,6 @@ private: QVector m_cookies; }; -WebProfile* loadProfile(const QString &name, const QHash &defaults, const QString &path = QString(), QObject *parent = nullptr); //WebProfile *saveProfile(WebProfile *profile, const QString &path); #endif // SMOLBOTE_WEBENGINEPROFILE_H -- cgit v1.2.1