Skip to content
This repository was archived by the owner on Apr 21, 2025. It is now read-only.

Commit 334b066

Browse files
committed
(ckb) Fixed auto-save not happening
1 parent 2fa219f commit 334b066

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

Diff for: VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
beta-v0.2.2+t05
1+
beta-v0.2.2+t06

Diff for: src/ckb/kb.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ void Kb::save(){
266266

267267
void Kb::autoSave(){
268268
quint64 now = QDateTime::currentMSecsSinceEpoch();
269-
if(now >= lastAutoSave + 15 * 1000 && !CkbSettings::isBusy()){
269+
if(needsSave() && now >= lastAutoSave + 15 * 1000 && !CkbSettings::isBusy()){
270270
save();
271271
lastAutoSave = now;
272272
}

Diff for: src/ckb/kb.h

+4-2
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,6 @@ class Kb : public QThread
8080
void load();
8181
void save();
8282
bool needsSave() const;
83-
// Auto-save every 15s (if settings have changed, and no other writes are in progress)
84-
void autoSave();
8583

8684
void hwSave();
8785

@@ -104,8 +102,12 @@ class Kb : public QThread
104102
void fwUpdateFinished(bool succeeded);
105103

106104
public slots:
105+
// Send lighting and settings to the driver
107106
void frameUpdate();
108107

108+
// Auto-save every 15s (if settings have changed, and no other writes are in progress)
109+
void autoSave();
110+
109111
private slots:
110112
// Processes lines read from the notification node
111113
void readNotify(QString line);

Diff for: src/ckb/kbmanager.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ void KbManager::scanKeyboards(){
141141
emit kbConnected(kb);
142142
kb->load();
143143
connect(_eventTimer, SIGNAL(timeout()), kb, SLOT(frameUpdate()));
144+
connect(_scanTimer, SIGNAL(timeout()), kb, SLOT(autoSave()));
144145
}
145146
}
146147

0 commit comments

Comments
 (0)