diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2019-11-22 19:34:09 +0200 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2019-11-22 20:05:31 +0200 |
commit | 62c3898d8e18a872700948c46a61592b315e79de (patch) | |
tree | 81f03b3012c07510202065f03aaec8cd1f9591fb /src/webengine/webprofile.cpp | |
parent | Configuration: only try reading it when cfg file can be opened (diff) | |
download | smolbote-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.cpp | 13 |
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) |