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 <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2020-02-08 22:34:00 +01:00 committed by Dirk Hohndel
parent 3bb9b08f33
commit 1f03a8be81

View file

@ -18,10 +18,6 @@ QString keyFromGroupAndName(QString group, QString name)
void qPrefPrivate::propSetValue(const QString &key, const QVariant &value, const QVariant &defaultValue) 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; QSettings s;
bool isDefault = false; bool isDefault = false;
if (value.isValid() && value.type() == QVariant::Double) 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) 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; QSettings s;
return s.value(key, defaultValue); return s.value(key, defaultValue);
} }