From 1f03a8be81527c2c32e66a169457340283c0e7ce Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sat, 8 Feb 2020 22:34:00 +0100 Subject: Cleanup: remove erroneous comments Remove two erroneous comments stating that a function-local QSettings variable should not be static because it is initialized too early. Scoped static variables are initialized when execution first hits the statement. Signed-off-by: Berthold Stoeger --- core/settings/qPrefPrivate.cpp | 8 -------- 1 file changed, 8 deletions(-) diff --git a/core/settings/qPrefPrivate.cpp b/core/settings/qPrefPrivate.cpp index 14fb1be1e..e1622c3e7 100644 --- a/core/settings/qPrefPrivate.cpp +++ b/core/settings/qPrefPrivate.cpp @@ -18,10 +18,6 @@ QString keyFromGroupAndName(QString group, QString name) void qPrefPrivate::propSetValue(const QString &key, const QVariant &value, const QVariant &defaultValue) { - // REMARK: making s static (which would be logical) does NOT work - // because it gets initialized too early. - // Having it as a local variable is light weight, because it is an - // interface class. QSettings s; bool isDefault = false; if (value.isValid() && value.type() == QVariant::Double) @@ -37,10 +33,6 @@ void qPrefPrivate::propSetValue(const QString &key, const QVariant &value, const QVariant qPrefPrivate::propValue(const QString &key, const QVariant &defaultValue) { - // REMARK: making s static (which would be logical) does NOT work - // because it gets initialized too early. - // Having it as a local variable is light weight, because it is an - // interface class. QSettings s; return s.value(key, defaultValue); } -- cgit v1.2.3-70-g09d2