aboutsummaryrefslogtreecommitdiff
path: root/lib/web/webprofile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/web/webprofile.cpp')
-rw-r--r--lib/web/webprofile.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/web/webprofile.cpp b/lib/web/webprofile.cpp
index 1124261..1613e52 100644
--- a/lib/web/webprofile.cpp
+++ b/lib/web/webprofile.cpp
@@ -13,8 +13,9 @@
#include <QWebEngineSettings>
WebProfile *WebProfile::profile = nullptr;
+QMap<QString, WebProfile *> WebProfile::profiles;
-WebProfile* loadProfile(const QString &name, const QHash<QString, QString> &defaults, const QString &path, QObject *parent)
+WebProfile* WebProfile::loadProfile(const QString &name, const QHash<QString, QString> &defaults, const QString &path, QObject *parent)
{
WebProfile *profile = nullptr;
#ifdef QT_DEBUG
@@ -36,6 +37,7 @@ WebProfile* loadProfile(const QString &name, const QHash<QString, QString> &defa
}
Q_CHECK_PTR(profile);
+ profiles.insert(name, profile);
profile->setSearch(config.value("search", defaults.value("profile.search")).toString());
profile->setHomepage(config.value("homepage", defaults.value("profile.homepage")).toUrl());
@@ -73,6 +75,10 @@ WebProfile* loadProfile(const QString &name, const QHash<QString, QString> &defa
WebProfile::WebProfile(const QString &name, const QString &configPath, QObject *parent)
: QWebEngineProfile(parent)
{
+ if(configPath.isEmpty())
+ m_id = configPath;
+ else
+ m_id = QFileInfo(configPath).baseName();
m_name = name;
m_configPath = configPath;
@@ -91,6 +97,7 @@ WebProfile::WebProfile(const QString &name, const QString &configPath, QObject *
WebProfile::WebProfile(const QString &storageName, const QString &name, const QString &configPath, QObject *parent)
: QWebEngineProfile(storageName, parent)
{
+ m_id = QFileInfo(configPath).baseName();
m_name = name;
m_configPath = configPath;