From 5e6920c427b30232e47039d26cbaec7173c837d2 Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Sat, 8 Sep 2018 15:41:10 +0200 Subject: Save WebProfile config when changed --- lib/web/webprofile.cpp | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'lib/web/webprofile.cpp') diff --git a/lib/web/webprofile.cpp b/lib/web/webprofile.cpp index d42bb26..4d31376 100644 --- a/lib/web/webprofile.cpp +++ b/lib/web/webprofile.cpp @@ -48,6 +48,17 @@ WebProfile::WebProfile(const QString &storageName, const QString &name, QObject }); } +const QString WebProfile::name() const +{ + return m_name; +} + +void WebProfile::setName(const QString &name) +{ + m_name = name; + emit nameChanged(name); +} + QString WebProfile::search() const { return m_search; @@ -84,35 +95,35 @@ void WebProfile::setNewtab(const QUrl &url) void WebProfile::setCachePath(const QString &path) { QWebEngineProfile::setCachePath(path); - emit cachePathChanged(QWebEngineProfile::cachePath()); + emit propertyChanged("cachePath", path); } void WebProfile::setPersistentStoragePath(const QString &path) { QWebEngineProfile::setPersistentStoragePath(path); - emit persistentStoragePathChanged(QWebEngineProfile::persistentStoragePath()); + emit propertyChanged("persistentStoragePath", path); } void WebProfile::setHttpAcceptLanguage(const QString &httpAcceptLanguage) { QWebEngineProfile::setHttpAcceptLanguage(httpAcceptLanguage); - emit httpAcceptLanguageChanged(QWebEngineProfile::httpAcceptLanguage()); + emit propertyChanged("httpAcceptLanguage", httpAcceptLanguage); } void WebProfile::setHttpCacheMaximumSize(int maxSize) { QWebEngineProfile::setHttpCacheMaximumSize(maxSize); - emit httpCacheMaximumSizeChanged(QWebEngineProfile::httpCacheMaximumSize()); + emit propertyChanged("httpCacheMaximumSize", maxSize); } void WebProfile::setHttpUserAgent(const QString &userAgent) { QWebEngineProfile::setHttpUserAgent(userAgent); - emit httpUserAgentChanged(QWebEngineProfile::httpUserAgent()); + emit propertyChanged("httpUserAgent", userAgent); } void WebProfile::setSpellCheckEnabled(bool enable) { QWebEngineProfile::setSpellCheckEnabled(enable); - emit spellCheckEnabledChanged(QWebEngineProfile::isSpellCheckEnabled()); + emit propertyChanged("spellCheckEnabed", enable); } -- cgit v1.2.1