diff options
Diffstat (limited to 'src/webengine')
-rw-r--r-- | src/webengine/webengineprofile.cpp | 23 | ||||
-rw-r--r-- | src/webengine/webengineprofile.h | 1 |
2 files changed, 15 insertions, 9 deletions
diff --git a/src/webengine/webengineprofile.cpp b/src/webengine/webengineprofile.cpp index 826bc44..de806df 100644 --- a/src/webengine/webengineprofile.cpp +++ b/src/webengine/webengineprofile.cpp @@ -30,8 +30,9 @@ WebEngineProfile::WebEngineProfile(QObject *parent) : WebEngineProfile::WebEngineProfile(const QString &storageName, QObject *parent) : QWebEngineProfile(storageName, parent) { - qDebug("Reading WebEngineProfile..."); - QSettings config(persistentStoragePath() + "/profile.ini", QSettings::IniFormat); + QString profilePath = persistentStoragePath() + "/profile.ini"; + qDebug("Reading profile from [%s]", qUtf8Printable(profilePath)); + QSettings config(profilePath, QSettings::IniFormat); config.beginGroup("http"); setHttpUserAgent(config.value("userAgent").toString()); @@ -40,12 +41,16 @@ WebEngineProfile::WebEngineProfile(const QString &storageName, QObject *parent) WebEngineProfile::~WebEngineProfile() { - if(!this->isOffTheRecord()) { - // save settings - QSettings config(persistentStoragePath() + "/profile.ini", QSettings::IniFormat); - config.beginGroup("http"); - config.setValue("userAgent", httpUserAgent()); - config.endGroup(); - config.sync(); + if(!isOffTheRecord()) { + saveProfile(); } } + +void WebEngineProfile::saveProfile() +{ + QSettings config(persistentStoragePath() + "/profile.ini", QSettings::IniFormat); + config.beginGroup("http"); + config.setValue("userAgent", httpUserAgent()); + config.endGroup(); + config.sync(); +} diff --git a/src/webengine/webengineprofile.h b/src/webengine/webengineprofile.h index dc07f4b..1845c99 100644 --- a/src/webengine/webengineprofile.h +++ b/src/webengine/webengineprofile.h @@ -35,6 +35,7 @@ public: signals: public slots: + void saveProfile(); }; #endif // WEBENGINEPROFILE_H |