mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
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:
parent
3bb9b08f33
commit
1f03a8be81
1 changed files with 0 additions and 8 deletions
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue