diff --git a/VERSION b/VERSION index 5cfc088c..4016513d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -beta-v0.2.2+t05 +beta-v0.2.2+t06 diff --git a/src/ckb/kb.cpp b/src/ckb/kb.cpp index dcc9c993..13e8c22c 100644 --- a/src/ckb/kb.cpp +++ b/src/ckb/kb.cpp @@ -266,7 +266,7 @@ void Kb::save(){ void Kb::autoSave(){ quint64 now = QDateTime::currentMSecsSinceEpoch(); - if(now >= lastAutoSave + 15 * 1000 && !CkbSettings::isBusy()){ + if(needsSave() && now >= lastAutoSave + 15 * 1000 && !CkbSettings::isBusy()){ save(); lastAutoSave = now; } diff --git a/src/ckb/kb.h b/src/ckb/kb.h index 96fb656c..17acf144 100644 --- a/src/ckb/kb.h +++ b/src/ckb/kb.h @@ -80,8 +80,6 @@ public: void load(); void save(); bool needsSave() const; - // Auto-save every 15s (if settings have changed, and no other writes are in progress) - void autoSave(); void hwSave(); @@ -104,8 +102,12 @@ signals: void fwUpdateFinished(bool succeeded); public slots: + // Send lighting and settings to the driver void frameUpdate(); + // Auto-save every 15s (if settings have changed, and no other writes are in progress) + void autoSave(); + private slots: // Processes lines read from the notification node void readNotify(QString line); diff --git a/src/ckb/kbmanager.cpp b/src/ckb/kbmanager.cpp index 26c51929..a9693279 100644 --- a/src/ckb/kbmanager.cpp +++ b/src/ckb/kbmanager.cpp @@ -141,6 +141,7 @@ void KbManager::scanKeyboards(){ emit kbConnected(kb); kb->load(); connect(_eventTimer, SIGNAL(timeout()), kb, SLOT(frameUpdate())); + connect(_scanTimer, SIGNAL(timeout()), kb, SLOT(autoSave())); } }