mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-04-12 00:33:29 +02:00
Merge pull request #8364 from sethalves/fix-settings-missing-key
fix bug which caused getValue for a non-existent key to return the integer 2
This commit is contained in:
commit
49ad0951dd
2 changed files with 2 additions and 2 deletions
|
@ -53,7 +53,7 @@ namespace Setting {
|
|||
const auto& key = handle->getKey();
|
||||
withWriteLock([&] {
|
||||
QVariant loadedValue;
|
||||
if (_pendingChanges.contains(key)) {
|
||||
if (_pendingChanges.contains(key) && _pendingChanges[key] != UNSET_VALUE) {
|
||||
loadedValue = _pendingChanges[key];
|
||||
} else {
|
||||
loadedValue = value(key);
|
||||
|
|
|
@ -46,7 +46,7 @@ namespace Setting {
|
|||
private:
|
||||
QHash<QString, Interface*> _handles;
|
||||
QPointer<QTimer> _saveTimer = nullptr;
|
||||
const QVariant UNSET_VALUE { QUuid::createUuid().variant() };
|
||||
const QVariant UNSET_VALUE { QUuid::createUuid() };
|
||||
QHash<QString, QVariant> _pendingChanges;
|
||||
|
||||
friend class Interface;
|
||||
|
|
Loading…
Reference in a new issue