diff options
Diffstat (limited to 'src/webengine/webengineprofile.cpp')
-rw-r--r-- | src/webengine/webengineprofile.cpp | 23 |
1 files changed, 14 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(); +} |