mirror of
https://github.com/lubosz/overte.git
synced 2025-08-07 16:41:02 +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();
|
const auto& key = handle->getKey();
|
||||||
withWriteLock([&] {
|
withWriteLock([&] {
|
||||||
QVariant loadedValue;
|
QVariant loadedValue;
|
||||||
if (_pendingChanges.contains(key)) {
|
if (_pendingChanges.contains(key) && _pendingChanges[key] != UNSET_VALUE) {
|
||||||
loadedValue = _pendingChanges[key];
|
loadedValue = _pendingChanges[key];
|
||||||
} else {
|
} else {
|
||||||
loadedValue = value(key);
|
loadedValue = value(key);
|
||||||
|
|
|
@ -46,7 +46,7 @@ namespace Setting {
|
||||||
private:
|
private:
|
||||||
QHash<QString, Interface*> _handles;
|
QHash<QString, Interface*> _handles;
|
||||||
QPointer<QTimer> _saveTimer = nullptr;
|
QPointer<QTimer> _saveTimer = nullptr;
|
||||||
const QVariant UNSET_VALUE { QUuid::createUuid().variant() };
|
const QVariant UNSET_VALUE { QUuid::createUuid() };
|
||||||
QHash<QString, QVariant> _pendingChanges;
|
QHash<QString, QVariant> _pendingChanges;
|
||||||
|
|
||||||
friend class Interface;
|
friend class Interface;
|
||||||
|
|
Loading…
Reference in a new issue