aboutsummaryrefslogtreecommitdiff
path: root/src/webengine/webprofile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/webengine/webprofile.cpp')
-rw-r--r--src/webengine/webprofile.cpp24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/webengine/webprofile.cpp b/src/webengine/webprofile.cpp
index 081e091..5b07645 100644
--- a/src/webengine/webprofile.cpp
+++ b/src/webengine/webprofile.cpp
@@ -21,27 +21,33 @@ void loadProfile(WebProfile *profile, const QString &path)
return;
#ifdef QT_DEBUG
- qDebug("Reading config for profile '%s': %s", qUtf8Printable(profile->name()), qUtf8Printable(path));
+ qDebug("+ Reading config for profile '%s': %s", qUtf8Printable(profile->name()), qUtf8Printable(path));
#endif
QSettings config(path, QSettings::IniFormat);
config.beginGroup("properties");
- for(const QString &key : config.childKeys()) {
+ {
+ const auto keys = config.childKeys();
+ for(const QString &key : keys) {
#ifdef QT_DEBUG
- qDebug("set property %s to %s", qUtf8Printable(key), qUtf8Printable(config.value(key).toString()));
+ qDebug("- set property %s to %s", qUtf8Printable(key), qUtf8Printable(config.value(key).toString()));
#endif
- profile->setProperty(qUtf8Printable(key), config.value(key));
+ profile->setProperty(qUtf8Printable(key), config.value(key));
+ }
}
config.endGroup(); // properties
config.beginGroup("attributes");
- auto *settings = profile->settings();
- for(const QString &key : config.childKeys()) {
+ {
+ const auto keys = config.childKeys();
+ auto *settings = profile->settings();
+ for(const QString &key : keys) {
#ifdef QT_DEBUG
- qDebug("set attribute %s to %s", qUtf8Printable(key), qUtf8Printable(config.value(key).toString()));
+ qDebug("- set attribute %s to %s", qUtf8Printable(key), qUtf8Printable(config.value(key).toString()));
#endif
- auto attribute = static_cast<QWebEngineSettings::WebAttribute>(key.toInt());
- settings->setAttribute(attribute, config.value(key).toBool());
+ auto attribute = static_cast<QWebEngineSettings::WebAttribute>(key.toInt());
+ settings->setAttribute(attribute, config.value(key).toBool());
+ }
}
config.endGroup();