mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-29 19:22:57 +02:00
fix bug which caused getValue for a non-existent key to return the integer 2
This commit is contained in:
parent
a1dc9beddb
commit
4c258b9568
2 changed files with 4 additions and 5 deletions
|
@ -70,12 +70,11 @@ namespace Setting {
|
||||||
QVariant handleValue = UNSET_VALUE;
|
QVariant handleValue = UNSET_VALUE;
|
||||||
if (handle->isSet()) {
|
if (handle->isSet()) {
|
||||||
handleValue = handle->getVariant();
|
handleValue = handle->getVariant();
|
||||||
}
|
|
||||||
|
|
||||||
withWriteLock([&] {
|
withWriteLock([&] {
|
||||||
_pendingChanges[key] = handleValue;
|
_pendingChanges[key] = handleValue;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static const int SAVE_INTERVAL_MSEC = 5 * 1000; // 5 sec
|
static const int SAVE_INTERVAL_MSEC = 5 * 1000; // 5 sec
|
||||||
void Manager::startTimer() {
|
void Manager::startTimer() {
|
||||||
|
|
|
@ -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