|
@ -27,13 +27,23 @@ void _cmpMoveIndexDown(const char * key, int offset = 0) { |
|
|
// 3: based on Embedis, with board definitions 0-based
|
|
|
// 3: based on Embedis, with board definitions 0-based
|
|
|
// 4: based on Embedis, no board definitions
|
|
|
// 4: based on Embedis, no board definitions
|
|
|
|
|
|
|
|
|
|
|
|
int migrateVersion() { |
|
|
|
|
|
const static auto version = getSetting("cfg", CFG_VERSION); |
|
|
|
|
|
if (version == CFG_VERSION) { |
|
|
|
|
|
return 0; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return version; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
void migrate() { |
|
|
void migrate() { |
|
|
|
|
|
|
|
|
// Update if not on the latest version
|
|
|
// Update if not on the latest version
|
|
|
const auto version = getSetting("cfg", CFG_VERSION); |
|
|
|
|
|
if (version == CFG_VERSION) return; |
|
|
|
|
|
|
|
|
const auto version = migrateVersion(); |
|
|
setSetting("cfg", CFG_VERSION); |
|
|
setSetting("cfg", CFG_VERSION); |
|
|
|
|
|
|
|
|
|
|
|
if (!version) return; |
|
|
|
|
|
|
|
|
switch (version) { |
|
|
switch (version) { |
|
|
// migrate old version with 1-based indices
|
|
|
// migrate old version with 1-based indices
|
|
|
case 2: |
|
|
case 2: |
|
|