diff options
Diffstat (limited to 'src/webengine/webprofile.h')
-rw-r--r-- | src/webengine/webprofile.h | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/src/webengine/webprofile.h b/src/webengine/webprofile.h index 37e3419..1ec2b88 100644 --- a/src/webengine/webprofile.h +++ b/src/webengine/webprofile.h @@ -19,29 +19,19 @@ #include <QWebEngineSettings> #include <profileinterface.h> +class WebProfileManager; class WebProfile : public Profile { + friend class WebProfileManager; + Q_OBJECT public: - // off-the-record constructor - explicit WebProfile(const QString &name, QObject *parent = nullptr); - // default constructor - explicit WebProfile(const QString &storageName, const QString &name, QObject *parent = nullptr); + static WebProfile *defaultProfile(); + static void setDefaultProfile(WebProfile *profile); ~WebProfile() = default; - static void setDefaultProfile(WebProfile *profile) - { - Q_CHECK_PTR(profile); - WebProfile::profile = profile; - } - static WebProfile *defaultProfile() - { - Q_CHECK_PTR(WebProfile::profile); - return WebProfile::profile; - } - const QString name() const; void setName(const QString &name); @@ -79,9 +69,13 @@ public: void setSpellCheckEnabled(bool enable); -private: - static WebProfile *profile; +protected: + // off-the-record constructor + explicit WebProfile(const QString &name, QObject *parent = nullptr); + // default constructor + explicit WebProfile(const QString &storageName, const QString &name, QObject *parent = nullptr); +private: QString m_name; QString m_search = QString("about:blank"); QUrl m_homepage = QUrl("about:blank"); |