aboutsummaryrefslogtreecommitdiff
path: root/src/webengine/webprofile.cpp
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2019-11-22 19:34:09 +0200
committerAqua-sama <aqua@iserlohn-fortress.net>2019-11-22 20:05:31 +0200
commit62c3898d8e18a872700948c46a61592b315e79de (patch)
tree81f03b3012c07510202065f03aaec8cd1f9591fb /src/webengine/webprofile.cpp
parentConfiguration: only try reading it when cfg file can be opened (diff)
downloadsmolbote-62c3898d8e18a872700948c46a61592b315e79de.tar.xz
WebProfile refactoring
- Remove WebProfileManager::Profile::value - Make WebProfile constructors protected, and WebProfileManager friend class
Diffstat (limited to 'src/webengine/webprofile.cpp')
-rw-r--r--src/webengine/webprofile.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/webengine/webprofile.cpp b/src/webengine/webprofile.cpp
index 843b78e..2cea409 100644
--- a/src/webengine/webprofile.cpp
+++ b/src/webengine/webprofile.cpp
@@ -12,7 +12,18 @@
#include <QWebEngineCookieStore>
#include <QWebEngineSettings>
-WebProfile *WebProfile::profile = nullptr;
+static WebProfile *s_profile = nullptr;
+
+void WebProfile::setDefaultProfile(WebProfile *profile)
+{
+ Q_CHECK_PTR(profile);
+ s_profile = profile;
+}
+WebProfile *WebProfile::defaultProfile()
+{
+ Q_CHECK_PTR(s_profile);
+ return s_profile;
+}
WebProfile::WebProfile(const QString &name, QObject *parent)
: Profile(parent)