aboutsummaryrefslogtreecommitdiff
path: root/lib/web/webprofile.h
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2018-06-24 17:27:44 +0200
committerAqua-sama <aqua@iserlohn-fortress.net>2018-06-24 17:27:44 +0200
commite81526f15e8c1e9c82b27009dbe512f78cf1dc0f (patch)
treeea9a140347b6077d0521f85da4f9d881185fbb90 /lib/web/webprofile.h
parentSplit shortcuts into new tab (diff)
downloadsmolbote-e81526f15e8c1e9c82b27009dbe512f78cf1dc0f.tar.xz
Add Session class
Diffstat (limited to 'lib/web/webprofile.h')
-rw-r--r--lib/web/webprofile.h11
1 files changed, 10 insertions, 1 deletions
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 <QWebEngineProfile>
#include <QVector>
#include <QNetworkCookie>
+#include <QMap>
class WebProfile : public QWebEngineProfile
{
@@ -53,6 +54,13 @@ public:
return WebProfile::profile;
}
+ static WebProfile* loadProfile(const QString &name, const QHash<QString, QString> &defaults, const QString &path = QString(), QObject *parent = nullptr);
+
+ const QString id() const
+ {
+ return profiles.key(const_cast<WebProfile*>(this), "");
+ }
+
QString name() const
{
return m_name;
@@ -104,7 +112,9 @@ signals:
private:
static WebProfile *profile;
+ static QMap<QString, WebProfile *> profiles;
+ QString m_id;
QString m_configPath;
QString m_name;
QString m_search = QString("about:blank");
@@ -114,7 +124,6 @@ private:
QVector<QNetworkCookie> m_cookies;
};
-WebProfile* loadProfile(const QString &name, const QHash<QString, QString> &defaults, const QString &path = QString(), QObject *parent = nullptr);
//WebProfile *saveProfile(WebProfile *profile, const QString &path);
#endif // SMOLBOTE_WEBENGINEPROFILE_H